javamavenmaven-shade-pluginmaven-deploy-plugin

Maven deploy plugin/shade plugin: don't deploy uber jar


I'm trying to both build an uber jar using the maven shade plugin (to build a docker image) and also deploy the project jars to a maven repository. I do not want to deploy the uber jar to the maven repo. Therefore, either I need to be able to exclude a particular file from the maven deploy plugin, or, make the maven shade plugin put the uber jar in a different location so it is not picked up by the deploy plugin.

Is either of these two things possible?


Solution

  • You can define two profiles: the default profile with shade plugin, and the other profile for deploy - without shade plugin. The deploy profile should also contain repository for deployment.