Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 2.0.2
-
Fix Version/s: 2.0.9, 3.0-alpha-1
-
Component/s: Dependencies
-
Labels:None
-
Complexity:Intermediate
-
Number of attachments :5
Description
I want to run two ant task, one on the phase 'generate-sources' which contains a dependency and another on the phase 'package'.
When I want to compile with the project like that, maven don't check the dependency.
But when I comment the plugin on the phase 'package', maven check it.
PS: In the pom.xml in attachement, maven must check the library junit:junit:jar:30.80.10 (which don't exsist)
-
- pom.xml
- 10/Mar/06 6:50 PM
- 1 kB
- Daiyam
-
- pom-echo.xml
- 11/Mar/06 4:02 PM
- 2 kB
- Yann Le Du
-
- pom-merge.xml
- 11/Mar/06 4:03 PM
- 1 kB
- Yann Le Du
-
- pom-profile.xml
- 12/Mar/06 3:02 AM
- 2 kB
- Daiyam
-
Hide
- test-suite.zip
- 13/Mar/06 12:10 PM
- 17 kB
- Yann Le Du
-
- pom-plugin-profile-1.xml 2 kB
- pom-plugin-profile-2.xml 2 kB
- pom-plugin-profile-3.xml 2 kB
- pom-plugin-profile-4.xml 2 kB
- pom-plugin-profile-5.xml 2 kB
- pom-plugin-profile-6.xml 2 kB
- pom-plugin-profile-7.xml 2 kB
- pom-plugin-profile-8.xml 2 kB
- pom-two-plugin-1.xml 2 kB
- pom-two-plugin-2.xml 2 kB
- pom-two-plugin-3.xml 2 kB
- pom-two-plugin-4.xml 2 kB
- pom-two-plugin-5.xml 2 kB
- pom-two-plugin-6.xml 2 kB
- pom-two-plugin-7.xml 2 kB
- pom-two-plugin-8.xml 2 kB
- pom-two-profile-1.xml 2 kB
- pom-two-profile-2.xml 2 kB
- pom-two-profile-3.xml 2 kB
- pom-two-profile-4.xml 2 kB
- pom-two-profile-5.xml 2 kB
- pom-two-profile-6.xml 2 kB
- pom-two-profile-7.xml 2 kB
- pom-two-profile-8.xml 2 kB
- summary.txt 5 kB
Issue Links
- relates to
-
MNG-3719
[regression] plugin execution ordering no longer POM ordered in 2.0.9
-
Activity
Thanks Yann, I didn't know about id or default id of the execution tag.
I have the same problem with the pom-profile.xml, I have several <plugin>s with the same <artifactId> but one in the build tag and another in build tage of a profile.
When I run "mvn -P compile-schemas package", it's don't check the dependency of the profile's plugin.
OK, I've made a small test suite, and here is a clumsy guess about the process. Let's assume that main <build> is assimilated to a <profile> (in first position).
In an <execution>, if no <id> is defined, then <id>default</id> is added
If an <execution> is defined in several activated <profile> with the same <id>, the <execution> in the last <profile> overwrites the <execution> in the first <profile>
If several <execution> with different <id> are defined in several activated <profile> for the same <artifactId>, they are merged in the first <profile>
If several <dependency> are defined in several activated <profile> for the same <artifactId>, they are NOT merged in the first <profile>
If several <plugin> are defined in the same <profile> with the same <artifactId>, I don't know what happens 
If no <plugin> is defined in main <build> for a given <artifactId>, the one in the first <profile> is copied into main <build>
I think that :
- because of points 1. and 2. , <id> should be mandatoty
- point 4. should be corrected
- situation in point 5. should not be allowed
this has to do with plugins not being reconfigured inside a multmodule project, I think. It's a lifecycle/plugin management issue.
Does that reconfiguration issue have a separate report, or should this be renamed?
Integrated some of the tests from the test-suite.zip into plain junit tests at a lower level, to guard against these problems in the future. Thanks, those were very helpful.
Things get indeed weird if you use several <plugin>s with the same <artifactId> : attached pom-echo.xml echoes 2 times "Hello world, I'm in generate-resources"
A better way to achieve your goal is to merge these 2 <execution>s as in attached pom-merge.xml (you must use <id>s to avoid duplicate "default" id)