java – 为什么使用maven shade插件重定位不起作用?
发布时间:2020-05-24 10:00:31 所属栏目:Java 来源:互联网
导读:我正在运行一个包含较新版本的Guava的Hadoop作业的 some trouble,而不是Hadoop发行版中包含的版本(CDH 5.2).这是一个已知问题.我尝试使用Maven shade插件解决它 by shading the libraries.因此,我在pom.xml中添加了以下行: plugin groupIdorg.apache.maven.p
|
我正在运行一个包含较新版本的Guava的Hadoop作业的 some trouble,而不是Hadoop发行版中包含的版本(CDH 5.2).这是一个已知问题.我尝试使用Maven shade插件解决它 by shading the libraries.因此,我在pom.xml中添加了以下行: <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>
<relocations>
<relocation>
<pattern>com.google</pattern>
<shadedPattern>thirdparty.com.google</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
不幸的是,阴影似乎不起作用.当我提取uber-JAR时,没有文件夹thirdparty / com / google,但仍然是com / google文件夹. 有人知道出了什么问题吗? 解决方法这对我有用:<relocations>
<relocation>
<pattern>com.google.</pattern>
<shadedPattern>thirdparty.com.google.</shadedPattern>
</relocation>
</relocations>
注意图案末尾的点. (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
