Maven 1.x Distribution Plugin
  1. Maven 1.x Distribution Plugin
  2. MPDIST-26

Allow distribution of artifact types other than jar (better solution then as indicated at http://jira.codehaus.org/browse/MPDIST-13?).

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7
    • Labels:
      None
    • Environment:
      Not of importance.
    • Number of attachments :
      2

      Description

      The goal dist:build-bin should also allow to include artifacts different then the ones created by jar:jar (e.g. wars, ears, ...). A solution was already proposed at http://jira.codehaus.org/browse/MPDIST-13.

      Currently, we're writing a postGoal for dist:prepare-bin-filesystem that:
      1. determines the current project 'type' (ejb, war, jar, ...)
      2. removes the already generated jar if the current project type is different from 'jar'
      3. attain the goal 'type':'type' to (re)create the artifact
      4. copy the artifact to the binary distribution directory

      Cf postGoal.xml included as attachment.

      This postGoal currently uses the property maven.multiproject.type from the multiproject plugin:
      1. maven.multiproject.type = 'master' :

      • master Maven project from which other projects can inherit (to avoid POM configuration duplication)
      • steps 1 and 2 of our custom postGoal are executed
        2. maven.multiproject.type <> 'master' :
      • Maven projects that create artifacts (jars, ears, ...)
      • type = 'jar' : step 1 executed
      • type <> 'jar' : steps 1 to 4 executed

      Cf multiprojectProperties.txt included as attachment.

      Having a solution similar to the postGoal but already integrated in the plugin would allow minimizing custom scripting in maven.xml and have a more generic dist plugin. Also remark that an alternative to using maven.multiproject.type can be chosen (e.g. maven.dist.artifact.type), in order to avoid being dependent on properties of the multiproject plugin.

      The only problem I can see is that the prereqs='jar:jar' in the dist plugin would somehow have to be replaced by a call <attainGoal name="$

      {type}:${type}

      "/>, meaning that it is possible that the goal $

      {type}:${type}

      will be called more than once.

      Regards,
      Davy Toch

      1. multiprojectProperties.txt
        3 kB
        Davy Toch
      2. postGoal.xml
        1 kB
        Davy Toch

        Activity

        Hide
        Lukas Theussl added a comment -

        Added a property maven.dist.bin.artifact.type.

        Show
        Lukas Theussl added a comment - Added a property maven.dist.bin.artifact.type.

          People

          • Assignee:
            Lukas Theussl
            Reporter:
            Davy Toch
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 4 hours
              4h
              Remaining:
              Remaining Estimate - 4 hours
              4h
              Logged:
              Time Spent - Not Specified
              Not Specified