Tuesday, 27 August 2013

Building Maven fat jar conditionally

Building Maven fat jar conditionally

I followed the example in Building a fat jar using maven and now I can run
the following to build/test and install my jars.
mvn clean compile install
However, install now takes a lot longer because we are now building a fat
jar. Is it possible to have two versions of install where one just builds
jars without dependencies and the other does that and in addition builds
the fat jar, like:
mvn clean compile install
mvn clean compile install-fatjar
I know install-fatjar is not a valid phase but just want to give an idea
of what I'm trying to accomplish, i.e. a conditional install where the fat
jar is built only when an option is provided.

No comments:

Post a Comment