The
mentioned earlier that assembly in the process of unpack and repackage will not merge the same name of the file but directly ignored, so will cause some problems, so we finally chose the file merge function shade plugin, implemented as follows:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactid>mave
N-shade-plugin</artifactid> <version>2.4.3</version> <executions>
<execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <CONFIGURATION&G
T <finalName>executable</finalName> <SHADEDARTIFACTATTACHED>TRUE</SHADEDARTIFAC
Tattached> <shadedClassifierName>Shaded</shadedClassifierName>
<shadedTestJar>true</shadedTestJar> <transformers>
<transformer implementation= "Org.apache.maven.plugins.shade.resource.ManifestResourceTransformer" > <mainclass>com.cloud ..... Publishertest</mainclass> </transformer> <transform Er implementation= "Org.apache.maven.plugins.shade.resource.AppendingTransformer" > <r
Esource>meta-inf/spring.handlers</resource> </transformer>
<transformer implementation= "Org.apache.maven.plugins.shade.resource.AppendingTransformer" >
<resource>META-INF/spring.schemas</resource> </transformer> <transformer implementation= "Org.apache.maven.plugins.shade.resource.AppendingTransformer" &
Gt
<resource>META-INF/spring.tooling</resource> </transformer> </transformers> </configuration> </execution> </executions> </plugin>
But in this way, I need to put the test class,test resouce in main because the shade package doesn't contain test-related stuff.