ant plugin only looks for jar files in directory named "target"
Metadata
Current evaluation
Ant now discovers JARs recursively across the part build directory, so the reported `lib` output layout no longer needs to be renamed to `target`; the issue is resolved.
Suggested action: close resolved
Reason: The current Ant plugin delegates JAR collection to JavaPlugin, which runs `find "${CRAFT_PART_BUILD}/" -iname "*.jar"` rather than searching only `target`, so the supplied `lib/HelloWorld.jar` layout is covered. This generalized discovery was introduced with the Java plugin base in commit `b628bddf` (`craft-parts#339`).
Evaluated by: mr-cal-bot
Impact:
46
Quick Win:
33
Complexity:
22
Confidence:
90
Actionability:
93
Issue body
I have the following build.xml for use with the ant plugin in snapcraft :
<project name="HelloWorld" basedir="." default="main">
<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="lib"/>
<property name="main-class" value="oata.HelloWorld"/>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="compile">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}"/>
</target>
<target name="jar" depends="compile">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
</jar>
</target>
<target name="run" depends="jar">
<java jar="${jar.dir}/${ant.project.name}.jar" fork="true"/>
</target>
<target name="clean-build" depends="clean,jar"/>
<target name="main" depends="clean,run"/>
</project>
After building the part which uses the ant plugin I get the error :
"Failed doing build for hello: could not find any built jar files for part".
If I change the line :
<property name="jar.dir" value="lib"/>
to
<property name="jar.dir" value="target"/>
the error goes away.
It would be useful to have a way to configure the location the ant plugin looks in for jar files.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha |
Impact:
46
Quick Win:
33
Complexity:
22
Confidence:
90
Actionability:
93
|
close resolved | Ant now discovers JARs recursively across the part build directory, so the reported `lib` output layout no longer needs to be renamed to `target`; the issue is resolved. | |
| qwen/qwen3.6-35b-a3b |
Impact:
30
Quick Win:
14
Complexity:
20
Confidence:
50
Actionability:
60
|
keep open | Ant plugin only looks for jar files in directory named 'target'; user requests configurability for jar search location | |
| qwen/qwen3.8-27b |
Impact:
20
Quick Win:
15
Staleness:
95
Complexity:
25
Confidence:
55
Support Request:
15
|
needs triage | Request to make the ant plugin's jar search directory configurable (hardcoded to 'target'). 10-year-old feature request with zero comments and no maintainer interaction; repo has since been heavily restructured. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
95
Complexity:
20
Confidence:
85
Support Request:
10
|
close stale | Request to configure the output directory for Snapcraft's ant plugin instead of hardcoding target. Issue is over 9 years old with no maintainer response. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
15
Confidence:
90
Support Request:
10
|
close stale | Feature request to configure the output directory for snapcraft's ant plugin instead of hardcoding target. Issue is over 9 years old with no maintainer response. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
95
Complexity:
25
Confidence:
90
Support Request:
10
|
close stale | Feature request to configure the jar output directory for the snapcraft ant plugin, which currently hardcodes target. Issue is over 10 years old with no maintainer interaction. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
craft-parts#339
(confidence 88%)
The JavaPlugin base added the recursive build-wide JAR discovery now used by the Ant plugin.
Related issues
No related issues found above the similarity threshold.