Uploaded image for project: 'Maven Shade Plugin'
  1. Maven Shade Plugin
  2. MSHADE-287

honor classpath order

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • None
    • None
    • None

    Description

      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

      https://stackoverflow.com/questions/4466526/order-of-class-loading-from-a-war-file

      https://stackoverflow.com/questions/2021227/control-the-classpath-ordering-of-jars-in-web-inf-lib-on-tomcat-5

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            weberjn Jürgen Weber
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: