diff --git a/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java b/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java index dc683d17ac..46eda3857a 100644 --- a/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java +++ b/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java @@ -136,6 +136,32 @@ public class PomConstructionTest } */ + /* FIXME: cf. MNG-3925 + public void testOrderOfMergedPluginExecutionsWithoutPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "merged-plugin-exec-order/wo-plugin-mngt/sub" ); + assertEquals( 5, ( (List) pom.getValue( "build/plugins[1]/executions" ) ).size() ); + assertEquals( "parent-1", pom.getValue( "build/plugins[1]/executions[1]/goals[1]" ) ); + assertEquals( "parent-2", pom.getValue( "build/plugins[1]/executions[2]/goals[1]" ) ); + assertEquals( "child-default", pom.getValue( "build/plugins[1]/executions[3]/goals[1]" ) ); + assertEquals( "child-1", pom.getValue( "build/plugins[1]/executions[4]/goals[1]" ) ); + assertEquals( "child-2", pom.getValue( "build/plugins[1]/executions[5]/goals[1]" ) ); + } + + public void testOrderOfMergedPluginExecutionsWithPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "merged-plugin-exec-order/w-plugin-mngt/sub" ); + assertEquals( 5, ( (List) pom.getValue( "build/plugins[1]/executions" ) ).size() ); + assertEquals( "parent-1", pom.getValue( "build/plugins[1]/executions[1]/goals[1]" ) ); + assertEquals( "parent-2", pom.getValue( "build/plugins[1]/executions[2]/goals[1]" ) ); + assertEquals( "child-default", pom.getValue( "build/plugins[1]/executions[3]/goals[1]" ) ); + assertEquals( "child-1", pom.getValue( "build/plugins[1]/executions[4]/goals[1]" ) ); + assertEquals( "child-2", pom.getValue( "build/plugins[1]/executions[5]/goals[1]" ) ); + } + //*/ + private PomArtifactResolver artifactResolver( String basedir ) { return new FileBasedPomArtifactResolver( new File( BASE_POM_DIR, basedir ) ); diff --git a/maven-project/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mngt/pom.xml b/maven-project/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mngt/pom.xml new file mode 100644 index 0000000000..cd5383cede --- /dev/null +++ b/maven-project/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mngt/pom.xml @@ -0,0 +1,71 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3925 + parent + 0.1 + pom + + Maven Integration Test :: MNG-3925 + + Test that plugin executions (in the same phase) are properly ordered after inheritance/merge with + parent executions. + + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-a + 1.0-SNAPSHOT + + + parent-1 + validate + + parent-1 + + + + parent-2 + validate + + parent-2 + + + + + validate + + parent-default + + + + + + + + diff --git a/maven-project/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mngt/sub/pom.xml b/maven-project/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mngt/sub/pom.xml new file mode 100644 index 0000000000..c14f8e37a4 --- /dev/null +++ b/maven-project/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mngt/sub/pom.xml @@ -0,0 +1,71 @@ + + + + + + 4.0.0 + + + org.apache.maven.its.mng3925 + parent + 0.1 + + + child + + Maven Integration Test :: MNG-3925 + + Test that plugin executions (in the same phase) are properly ordered after inheritance/merge with + parent executions. + + + + + + org.apache.maven.its.plugins + maven-it-plugin-a + 1.0-SNAPSHOT + + + child-1 + validate + + child-1 + + + + child-2 + validate + + child-2 + + + + + validate + + child-default + + + + + + + diff --git a/maven-project/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/pom.xml b/maven-project/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/pom.xml new file mode 100644 index 0000000000..90d2bef8e4 --- /dev/null +++ b/maven-project/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/pom.xml @@ -0,0 +1,69 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3925 + parent + 0.1 + pom + + Maven Integration Test :: MNG-3925 + + Test that plugin executions (in the same phase) are properly ordered after inheritance/merge with + parent executions. + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-a + 1.0-SNAPSHOT + + + parent-1 + validate + + parent-1 + + + + parent-2 + validate + + parent-2 + + + + + validate + + parent-default + + + + + + + diff --git a/maven-project/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/sub/pom.xml b/maven-project/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/sub/pom.xml new file mode 100644 index 0000000000..c14f8e37a4 --- /dev/null +++ b/maven-project/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/sub/pom.xml @@ -0,0 +1,71 @@ + + + + + + 4.0.0 + + + org.apache.maven.its.mng3925 + parent + 0.1 + + + child + + Maven Integration Test :: MNG-3925 + + Test that plugin executions (in the same phase) are properly ordered after inheritance/merge with + parent executions. + + + + + + org.apache.maven.its.plugins + maven-it-plugin-a + 1.0-SNAPSHOT + + + child-1 + validate + + child-1 + + + + child-2 + validate + + child-2 + + + + + validate + + child-default + + + + + + +