achennagiri commented on a change in pull request #2824:
URL: https://github.com/apache/hive/pull/2824#discussion_r799676734
##########
File path: beeline/pom.xml
##########
@@ -233,6 +233,53 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ <finalName>jar-with-dependencies</finalName>
+ <transformers>
+ <transformer
implementation="com.github.edwgiz.mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer"
/>
+ <transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
Review comment:
So, what that transformer exactly does is this,
log4j2 is plug-in programming. When the log4j2 package is compiled, or the
package containing the log4j2 plug-in is compiled, the plug-in information that
needs to be loaded will be placed in
META-INF/org/apache/logging/log4j/core/config/plugins/ Log4j2Plugins.dat
(including the official logj42 native plug-in), and then when the project
starts, log4j2 will scan the plug-in information file in the META-INF directory
of each jar package, and then load the plug-in.
But when the project is marked as a jar package, if there are
Log4j2Plugins.dat files in two different jar packages, there will be a problem,
one of the files will be overwritten by the other, resulting in a file when the
project starts The plug-in cannot be loaded normally, resulting in an error.
To solve this problem, when all jar packages are labeled as one jar package,
the Log4j2Plugins.dat in each jar package needs to be merged. This is what the
maven-shade-plugin.log4j2-cachefile-transformer package does.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]