Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.7
-
Component/s: None
-
Labels:None
-
Environment:Not of importance.
-
Number of attachments :
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
Added a property maven.dist.bin.artifact.type.