Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Duplicate
-
Affects Version/s: 1.5
-
Fix Version/s: None
-
Labels:None
Description
pre/postGoal defined in plugins are only called once during multiproject goals.
You can reproduce this problem by the following:
maven genapp -Dmaven.genapp.template=default -Dmaven.genapp.template.id=parent -Dmaven.genapp.template.name=Parent -Dmaven.genapp.template.package=parent
create child1 and child2 directories
in child1 directory:
maven genapp -Dmaven.genapp.template=default -Dmaven.genapp.template.id=child1 -Dmaven.genapp.template.name=Child1 -Dmaven.genapp.template.package=child1
in child2 directory:
maven genapp -Dmaven.genapp.template=default -Dmaven.genapp.template.id=child2 -Dmaven.genapp.template.name=Child2 -Dmaven.genapp.template.package=child2
running maven multiproject:goal -Dgoal=clean in the parent project gives the following:
<snip />
+----------------------------------------
| Executing clean Child1 |
| Memory: 3M/4M +---------------------------------------- build:start: |
clean:clean:
Running post goal: clean:clean
+----------------------------------------
| Executing clean Child2 |
| Memory: 3M/4M +---------------------------------------- |
clean:
build:end:
build:start:
clean:clean:
clean:
build:end:
<snip />
The "Running post goal: clean:clean" appears only once. (If you run maven multiproject:clean, you will see that it only gets run on the parent project.)
As a workaround, you need to copy the pre/postGoal from the plugin.jelly to each (except for the first) project's maven.xml. However, this will cause multiple runs when you do individual child runs.
Issue Links
- duplicates
-
MAVEN-1638
Post goals in plugins only seem to run once
-
Please check that this is fixed with one of the recent 1.1-beta-3 snapshots: http://people.apache.org/~aheritier/maven/1.X/snapshots/