私のプロジェクトの pom.xml には、次の依存関係があります。
<dependency>
<groupId>com.my.library</groupId>
<artifactId>MyLib</artifactId>
<version>1.0</version>
<type>jar</type>
</dependency>
<dependency>
...
</dependency>
com.my.library:MyLib
上記の依存関係のクラスを含むプロジェクトの最終ビルド jar を作成したいので、次のようにmaven-shade-pluginを使用しました。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>com.my.library:MyLib</artifact>
<includes>
<include>com/my/library/**</include>
</includes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
次に、 を実行するmvn clean install
と、プロジェクトが正常にビルドされました。
しかし、ディレクトリの下のMyProject.jartarget/
の内容を確認すると、依存関係からのクラスが含まれていませんcom.my.library:MyLib
。なぜですか? maven-shade-plugin のどこが間違っていますか?