I want to use Maven to create two separate jars for my project.
One that will include everything under the **/client package and one that will include everything under the **/server package. The client package should also contain the sources.
Question 1: How can I setup my pom to produce these two separate jars?
Question 2: Is it possible to create both with a single maven command?
Any help is appreciated.
Thank you very much!
After hours of searching, researching, banging my head against the desk, bleeding, and crying, I have solved this by using Maven’s assembly plug-in.
Here is how it goes:
I created two separate assembly descriptors. Firstly,
${basedir}/src/main/assembly/client.xml(src/main/assemblyis apparently the standard place for Maven assembly descriptors)then
${basedir}/src/main/assembly/server.xmland added the following to my
pom.xml:run
mvn package… aaand voila!!! One command… two JARs!… so easy that I want to cry for all the time I spent trying to find the solution.