The reason:

Solution:

Maven-shade plugin is solved as follows:

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> The < 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>
Copy the code

Problems encountered:

  1. Since this project requires that hive shade package cannot be extracted, all of them are referenced separately in multiple modules. Reference to the Hive-shade package alone will cause the reference to be lost in the project where the hive-exec package is referenced. In this case, you need to perform two operations:
  • (1) Install hive-shade package separately
  • (2) add a separate reference to hive-exec in module and modify scope to provide.

Maven scope,

  1. < img style = “padding-bottom: 0px; padding-bottom: 0px; line-height: 21px;