maven-shade插件解决,如下为plugin配置:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.0.0</version> <configuration> <keepDependenciesWithProvidedScope>false</keepDependenciesWithProvidedScope> <promoteTransitiveDependencies>false</promoteTransitiveDependencies> <createDependencyReducedPom>true</createDependencyReducedPom> <minimizeJar>false</minimizeJar> <createSourcesJar>false</createSourcesJar> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <artifactSet> <includes> <include>org.apache.hive:hive-exec</include> </includes> </artifactSet> <filters> <filter> <artifact>*:*</artifact> <excludes> <exclude>META-INF/*.SF</exclude> <exclude>META-INF/*.DSA</exclude> <exclude>META-INF/*.RSA</exclude> </excludes> </filter> </filters> <relocations> <relocation> <pattern>com.google.guava</pattern> <shadedPattern>com.medata.google.guava</shadedPattern> </relocation> <relocation> <pattern>com.google.common</pattern> <shadedPattern>com.medata.google.common</shadedPattern> </relocation> </relocations> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer" /> </transformers> </configuration> </execution> </executions> 复制代码
maven scope详解