Search code examples
javabuildant

Apache Ant - how to include files which are imported from different folder (and package)?


I have basically no experience with Ant, so this is probably really simple problem.

Right now I have this:

<target name="compile-converter" description="Compile the converter.">
        <mkdir dir="${classes.build.dir}/converter" />
        <javac destdir="${classes.build.dir}/converter" debug="true" includeantruntime="false">
            <src path="${java.src.main.dir}" />
            <classpath>
                <pathelement path="${awh.jar.path}" />
            </classpath>
            <compilerarg value="-Xlint:all" />
        </javac>
    </target>

    <target name="compile-plugins" depends="compile-converter" description="Compile the plugins.">
        <mkdir dir="${classes.build.dir}/plugins" />
        <javac destdir="${classes.build.dir}/plugins" debug="true" includeantruntime="false">
            <src path="${java.src.plugins.dir}" />
            <classpath>
                <pathelement path="${awh.jar.path}" />
            </classpath>
            <compilerarg value="-Xlint:all" />
        </javac>
    </target>

The properties are set before this. When I run Ant, it says, that the imoports in the plugins dont exits. I guess it has to do something with classpath, but I have no idea how to do this.
The class that is supposed to be missing is located in the file, that is compiled in the "compile-converter" target. Both files are in different folders and package.


Solution

  • I solved it by adding a pathelement pointing at ${classes.build.dir}/converter"