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

Add ability for shade to find primary artifact from attached artifacts (similar to assembly-plugin)

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.0
    • None
    • None
    • all
    • Patch

    Description

      When switching from assembly-plugin to shade-plugin for a given project, I discovered that the shade plugin did not have the capability of using an attached artifact as the primary artifact - only the project's main artifact was supported.

      I've attached changes to add a configuration parameter "alternativeInputClassifier", which, when specified, tells the plugin to look for an artifact with the specified classifier in the project attachments, and to use that as the primary artifact. This makes shade behave similar to assembly-plugin, and allows shade to recognize attached artifacts generated by previous plugins in a maven execution.

      This was a trivial change, but required modifying several other classes and methods to accept the "primary" artifact as a parameter instead of a global variable. IMHO these changes are good for the plugin as a whole, as it will allow for future flexibility and logic for determining the entrypoint for the plugin (e.g. being able to run as a standalone goal with a specific artifact as input).

      Attachments

        1. patch.txt
          14 kB
          Richard Sand
        2. patch139and154.txt
          16 kB
          Richard Sand

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rsand2 Richard Sand
              Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: