Maven 1.x Distribution Plugin

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
  • Component/s: None
  • 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

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

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

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