Reputation: 10091
How does one go about creating two Jars from one project source folder? Is that possible, or must I create another project? My project uses Ant right now to generate one Jar. For example, say I want to split up the class files like this:
Jar 1:
com.myproject.Foo
com.myproject.Bar
Jar 2:
com.myproject.FooBar
com.myproject.BarFoo
com.myproject.FooBarFoo
...
Upvotes: 1
Views: 592
Reputation: 691655
See http://ant.apache.org/manual/Tasks/jar.html. You just have to use filesets or includes/excludes inside your jar task to include only the files you want in each jar:
<target name="makeJars">
<jar destfile="jar1.jar"
basedir="classes"
includes="com/myproject/Foo.class, com/myproject/Bar.class"/>
<jar destfile="jar2.jar"
basedir="classes"
includes="com/myproject/FooBar.class, com/myproject/BarFoo.class, com/myproject/FooBarFoo.class" />
</target>
Upvotes: 1