【发布时间】:2017-07-26 13:35:41
【问题描述】:
我正在使用 Maven Shade 插件来重新定位 Apache 的某些类。 我面临的问题是我将这个字符串作为我的课程的一部分:
private static final String ORG_APACHE_HTTP_HTTP_REQUEST = "org.apache.http.HttpRequest"
但是 Maven Shade 插件将其更改为
private static final String ORG_APACHE_HTTP_HTTP_REQUEST = "com.company.dependencies.org.apache.http.HttpRequest"
有没有办法让我的课程不被 maven shade 插件修改?
当前配置
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>false</minimizeJar>
<relocations>
<relocation>
<pattern>org.apache</pattern> <shadedPattern>com.company.org.apache</shadedPattern>
<excludes><exclude>com.company.ClassToBeExcluded</exclude>
</excludes>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
【问题讨论】:
标签: maven maven-plugin maven-shade-plugin