I have been trying to get jar using Maven Shade Plugin, but I still don't get a success.
This is my project structure:
MainModule
-Module1
-src
-pom.xml
-Module2
-src
-pom.xml
-pom.xml
Module1 (pom.xml):
<parent>
<artifactId>MainModule</artifactId>
<groupId>com.plugintest</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>Module1</artifactId>
Module2 (pom.xml):
<parent>
<artifactId>MainModule</artifactId>
<groupId>com.plugintest</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>Module1</artifactId>
MainModule (pom.xml):
<groupId>com.plugintest</groupId>
<artifactId>MainModule</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
<module>Module1</module>
<module>Module2</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
According this code I get 2 jar-files (Module1-version.jar and Module2-version.jar). But it is not what I want. I wish to get 1 jar file (MainModule-version.jar), which would contain the other (Module1 and Module2).
Why doesn't this Shade Plugin work?