Hi,
I use other java projects in my development, but In my case the unique way that I know is using the file manifest.xml
One example:
<package>
<description brief="lcp_proxy">
lcp_proxy
</description>
<author>Juan Antonio Breña Moral & Lawrie Griffiths</author>
<license>BSD</license>
<review status="unreviewed" notes=""/>
<url>http://ros.org/wiki/nxt_lejos_ros</url>
<depend package="rosjava"/>
<depend package="rosjava" />
<depend package="std_msgs" />
<depend package="sensor_msgs" />
<depend package="geometry_msgs" />
<depend package="nav_msgs" />
<depend package="nxt_msgs" />
<depend package="nxt_lejos_ros_msgs" />
<depend package="turtlesim" />
<depend package="tf" />
<export>
<rosjava-src location="src" />
<rosjava-pathelement location="target/" groupId="org.lejos.ros" artifactId="org.lejos.ros.nodes.LCPProxy" version="0.0.1" built="true" />
<rosjava-pathelement location="build/" built="true" />
<rosjava-pathelement location="/usr/local/lejos/lib/pc/pccomm.jar" />
<rosjava-pathelement location="/usr/local/lejos/lib/pc/3rdparty/bluecove-gpl.jar" />
<rosjava-pathelement location="/usr/local/lejos/lib/pc/3rdparty/bluecove.jar" />
<rosjava-pathelement location="/home/jabrena/ros3/workspace/nxt_lejos_ros/NXTLoader/lib/yamlbeans-1.06.jar" />
</export>
</package>
An example to create a jar file using Ant:
<project name="project2" basedir="." default="jar">
<property name="build" value="bin"/> <property name="misc" value="misc"/> <target name="jar"> <jar destfile="./ardroneDemo.jar">
<fileset dir="${build}"/>
<fileset dir="${misc}"/> <manifest>
<attribute name="Main-Class"
value="com.javadrone.test.KeyEventDemo"/>
<attribute name="Class-Path"
value="lib/JavaDrone-1.1.jar lib/log4j-1.2.16.jar"/> </manifest> </jar> </target> </project>