i'm using maven build jar-with-dependencies jar. 1 of vendor jar files in project has named classes different case. example am.class , am.class.
when build creates "jar-with-dependencies" jar file, am.class present. am.class appears have been overwritten or skipped. same thing happens every named classes files.
we have couple work-arounds, i'm curious why maven build behaving way. thanks
my pom:
<plugin> <artifactid>maven-assembly-plugin</artifactid> <version>2.1</version> <configuration> <archive> <manifest> <mainclass>com.mytest.mytest</mainclass> </manifest> </archive> <descriptorrefs> <descriptorref>jar-with-dependencies</descriptorref> </descriptorrefs> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> <dependencies> <dependency> <groupid>com.bloomberglp</groupid> <artifactid>blpapi3</artifactid> <version>3.10.1</version> </dependency> </dependencies>
same class conflict issue happen maven-assembly-plugin, plugin extracts dependency jars raw classes, , group together.it works in project less dependencies only, large project many dependencies, cause java class name conflict issue, check here.
better way use maven-shade-plugin if have many jars potentially conflict. can relocating feature in shade plugin explicitly avoid conflicts
Comments
Post a Comment