maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jürgen Weber (JIRA) <>
Subject [jira] [Commented] (MSHADE-287) honor classpath order
Date Tue, 10 Apr 2018 19:21:00 GMT


Jürgen Weber commented on MSHADE-287:

We had a case where a Spring Boot application would work standalone, but not in a JBoss .war.
( [1]) Cause was a different classpath order in WEB-INF/lib

The Spring Boot application's classpath (and its order) is defined by pom.xml, but the order
of the jars in WEB-INF/lib is undefined (actually it is the result of
which depends on the underlaying filesystem implementation).

A work around for the order problem in WEB-INF/lib is:

for jar in reverse(classpath)

     unpack jar overwrite=true into directory d

create jar of d

This jar will show the same resources as the original pom classpath.

Of course one can implement this with a few lines of python or bash, but it would be great,
if this could be done with a Maven plugin.




> honor classpath order
> ---------------------
>                 Key: MSHADE-287
>                 URL:
>             Project: Maven Shade Plugin
>          Issue Type: Improvement
>            Reporter: Jürgen Weber
>            Priority: Major
> Shade Plugin should be able to honor classpath order semantics: -cp a.jar:b.jar has the
effect that resources in b.jar are not visible if also in a.jar
> It should be possible to have the same effect with Shade Plugin: iterate for last to
first in classpath: extract current element overwriting content of previous extracted.
> use case:
> running an app with Maven has a defined classpath order, whereas the order of jars in
WEB-INF/lib is rather random. So you could build an ueber jar containing all jars of lib which
would result in the desired class order.
> This is currently not possible with org.apache.maven.plugins.shade.ShadeRequest as the
input jars are in a java.util.Set which has no order.
> See 
> []
> []

This message was sent by Atlassian JIRA

View raw message