java – Maven获取特定类
作者:互联网
有没有一种方法可以让maven在将依赖项导入uber jar(shade)时只包含特定的.class文件.我正在寻找一种方法来获取其名称中包含“Client”的文件,这些文件将被从依赖项jar中拉出并添加到最终的jar中.任何帮助都会很精彩.
解决方法:
您应该能够像这样使用maven-dependency-plugin:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>unpack</id>
<phase>package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId><!--dependency groupId--></groupId>
<artifactId><!--dependency artifactId--></artifactId>
<version><!--depedency version--></version>
<includes>**/*Client*.java</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
标签:java,amazon-web-services,maven,maven-plugin 来源: https://codeday.me/bug/20190829/1763442.html