I started work on a project that is currently creating a monolithic JAR file from an Eclipse project. Basically, there is an Ant script that runs anytime Java Builder Eclipse starts up and prints Java Builder Eclipse output (.class files) and packages that are in the JAR file. This JAR file is then placed in a shared directory so other tools can capture it for the latest build.
This works well for the team, so I donβt want to change it too much, but there are a lot of unnecessary files in this JAR file, which makes it much more than necessary. I was wondering if it is possible in the same structure as I described above (Eclipse + Ant) to split a large JAR file into smaller, more manageable JAR files. For instance:
com.company.project.thing1 com.company.project.thing2 com.company.project.thing3
All three things are packed in a JAR. Instead, I want thing1 and thing2 in the same JAR file and thing3 to be in the second JAR file.
I understand that I can have separate projects, but I wanted to see if I managed to save the project together, because it makes sense. Any help would be greatly appreciated.
Thanks.
At the request of the Ant Build script (I only included the jar task - the other is just clean):
<target name="jar" description="Deploys the JAR file." depends="clean"> <mkdir dir="${dir.dist}"> <jar destfile="${dir.dist}/${build.name}.jar"> <manifest> <attribute name="Built-By" value="${user.name}" /> <attribute name="Release-Version" value=${version}" /> </manifest> <zipfileset dir="${dir.build}" /> </jar> </target>
source share