I am trying to build an executable jar program using a ant script. When the project doesn't have any dependencies it works fine, but when I add another project as dependency, the ant script don't find the classes from this.
I did a simple just to test and understand how it works.
Follow:
Ant script example:
<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}" includes="*.class" >
<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>
My project structure is like this:
AntHelloWorld depends AntTest. My build.xml is in AntHelloWorld and I wanna modify my ant build.xml to works with the project dependency. (I can't post images yet)
I tried to find this and I just saw how to do this with jar dependencies, How to build an executable jar with external jar?
This is my first question in stackoverflow, feel free to inform where can I improve.