ant plugin only looks for jar files in directory named "target"

Bug #1597075 reported by Jenny Murphy
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Snapcraft
Confirmed
Undecided
Unassigned

Bug Description

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.

tags: added: bitesize
Leo Arias (elopio)
tags: added: plugin
Changed in snapcraft:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.