At the end of my "package" step I end up with 2 jars : the one made by the "maven-jar-plugin" and the uber/fat/shaded one made by "maven-shade-plugin".
myapp.jar
and myapp-uber.jar
At the "install" phase both jar are copied to the local repository. And I see little (=no) reason to have the uber jar copied to my local repository. Further more, it takes unless place on my HDD. And, anyway it will copied to right location at the "deploy" phase.
Here are those instructions :
<!-- Regular jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<phase>package</phase>
</execution>
</executions>
<configuration>
<archive>
<manifestEntries>
<SplashScreen-Image>icons/splash.png</SplashScreen-Image>
<url>${project.url}</url>
</manifestEntries>
</archive>
</configuration>
</plugin>
<!-- Uber jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>exe</shadedClassifierName>
<finalName>${project.exe_finalname}</finalName>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>myapp.MainClass</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<!-- Deploy -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>deploy</phase>
<configuration>
<target name="Pushing to builds repository"><!-- ... --></target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
So how can I prevent the uber jar from being copied to the local repository ?
Thanks.