From 98022663f01c4bdf827d1c7d626759b055a5ecd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Sat, 13 Jun 2026 12:32:06 +0200 Subject: [PATCH] update deployAtEnd ITs to match latest 4 behaviour --- .../verify.groovy | 15 ++++++++++++--- .../verify.groovy | 15 ++++++++++++--- .../pom.xml | 2 +- .../verify.groovy | 15 ++++++++++++--- .../pom.xml | 2 +- .../verify.groovy | 18 +++++++++++++++--- 6 files changed, 53 insertions(+), 14 deletions(-) diff --git a/src/it/MDEPLOY-169_deploy-at-end-multithread/verify.groovy b/src/it/MDEPLOY-169_deploy-at-end-multithread/verify.groovy index e06044f4..43461cba 100644 --- a/src/it/MDEPLOY-169_deploy-at-end-multithread/verify.groovy +++ b/src/it/MDEPLOY-169_deploy-at-end-multithread/verify.groovy @@ -17,6 +17,15 @@ * under the License. */ -assert new File( basedir, "target/repo/org/apache/maven/its/mdeploy-169/multithread/1.0/multithread-1.0.pom" ).exists() -assert new File( basedir, "module1/target/repo/org/apache/maven/its/mdeploy-169/module1/1.0/module1-1.0.pom" ).exists() -assert new File( basedir, "module2/target/repo/org/apache/maven/its/mdeploy-169/module2/1.0/module2-1.0.pom" ).exists() +rootRepo = new File( basedir, "target/repo" ) +module1Repo = new File( basedir, "module1/target/repo" ) +module2Repo = new File( basedir, "module2/target/repo" ) + +if (mavenVersion.startsWith('4.')) { + // Maven 4 deploys in the root target directory, as defined in the root POM + module1Repo = module2Repo = rootRepo +} + +assert new File( rootRepo, "org/apache/maven/its/mdeploy-169/multithread/1.0/multithread-1.0.pom" ).exists() +assert new File( module1Repo, "org/apache/maven/its/mdeploy-169/module1/1.0/module1-1.0.pom" ).exists() +assert new File( module2Repo, "org/apache/maven/its/mdeploy-169/module2/1.0/module2-1.0.pom" ).exists() diff --git a/src/it/MDEPLOY-170_deploy-at-end-configperproject/verify.groovy b/src/it/MDEPLOY-170_deploy-at-end-configperproject/verify.groovy index 6dfba56a..c32fe820 100644 --- a/src/it/MDEPLOY-170_deploy-at-end-configperproject/verify.groovy +++ b/src/it/MDEPLOY-170_deploy-at-end-configperproject/verify.groovy @@ -17,6 +17,15 @@ * under the License. */ -assert new File( basedir, "target/repo/org/apache/maven/its/mdeploy-170/configperproject/1.0/configperproject-1.0.pom" ).exists() -assert new File( basedir, "module1/target/repo/org/apache/maven/its/mdeploy-170/module1/1.0/module1-1.0.pom" ).exists() -assert !( new File( basedir, "module2/target/repo/org/apache/maven/its/mdeploy-170/module2/1.0/module2-1.0.pom" ).exists() ) +rootRepo = new File( basedir, "target/repo" ) +module1Repo = new File( basedir, "module1/target/repo" ) +module2Repo = new File( basedir, "module1/target/repo" ) + +if (mavenVersion.startsWith('4.')) { + // Maven 4 deploys in the root target directory, as defined in the root POM + module1Repo = module2Repo = rootRepo +} + +assert new File( rootRepo, "org/apache/maven/its/mdeploy-170/configperproject/1.0/configperproject-1.0.pom" ).exists() +assert new File( module1Repo, "org/apache/maven/its/mdeploy-170/module1/1.0/module1-1.0.pom" ).exists() +assert !( new File( module2Repo, "org/apache/maven/its/mdeploy-170/module2/1.0/module2-1.0.pom" ).exists() ) diff --git a/src/it/MDEPLOY-224_deploy-at-end-only-modules/pom.xml b/src/it/MDEPLOY-224_deploy-at-end-only-modules/pom.xml index f40c64ac..05c561cc 100644 --- a/src/it/MDEPLOY-224_deploy-at-end-only-modules/pom.xml +++ b/src/it/MDEPLOY-224_deploy-at-end-only-modules/pom.xml @@ -28,7 +28,7 @@ under the License. pom - Tests deployment at end only in modules. + Tests deployment at end only in modules. https://github.com/apache/maven-deploy-plugin/issues/374 diff --git a/src/it/MDEPLOY-224_deploy-at-end-only-modules/verify.groovy b/src/it/MDEPLOY-224_deploy-at-end-only-modules/verify.groovy index 063f2aee..69093780 100644 --- a/src/it/MDEPLOY-224_deploy-at-end-only-modules/verify.groovy +++ b/src/it/MDEPLOY-224_deploy-at-end-only-modules/verify.groovy @@ -17,9 +17,18 @@ * under the License. */ -assert new File( basedir, "target/repo/org/apache/maven/its/mdeploy-224/parent/1.0/parent-1.0.pom" ).exists() -assert new File( basedir, "module1/target/repo/org/apache/maven/its/mdeploy-224/module1/1.0/module1-1.0.pom" ).exists() -assert new File( basedir, "module2/target/repo/org/apache/maven/its/mdeploy-224/module2/1.0/module2-1.0.pom" ).exists() +rootRepo = new File( basedir, "target/repo" ) +module1Repo = new File( basedir, "module1/target/repo" ) +module2Repo = new File( basedir, "module2/target/repo" ) + +if (mavenVersion.startsWith('4.')) { + // Maven 4 deploys in the root target directory, as defined in the root POM + module1Repo = module2Repo = rootRepo +} + +assert new File( rootRepo, "org/apache/maven/its/mdeploy-224/parent/1.0/parent-1.0.pom" ).exists() +assert new File( module1Repo, "org/apache/maven/its/mdeploy-224/module1/1.0/module1-1.0.pom" ).exists() +assert new File( module2Repo, "org/apache/maven/its/mdeploy-224/module2/1.0/module2-1.0.pom" ).exists() def buildLog = new File ( basedir, "build.log").text diff --git a/src/it/MDEPLOY-225_deploy-at-end-skip-root/pom.xml b/src/it/MDEPLOY-225_deploy-at-end-skip-root/pom.xml index 8ac0f820..1ffe9602 100644 --- a/src/it/MDEPLOY-225_deploy-at-end-skip-root/pom.xml +++ b/src/it/MDEPLOY-225_deploy-at-end-skip-root/pom.xml @@ -28,7 +28,7 @@ under the License. pom - Tests deployment at end with skipped root project. + Tests deployment at end with skipped root project. https://github.com/apache/maven-deploy-plugin/issues/533 diff --git a/src/it/MDEPLOY-225_deploy-at-end-skip-root/verify.groovy b/src/it/MDEPLOY-225_deploy-at-end-skip-root/verify.groovy index edcc0b97..03ecebb5 100644 --- a/src/it/MDEPLOY-225_deploy-at-end-skip-root/verify.groovy +++ b/src/it/MDEPLOY-225_deploy-at-end-skip-root/verify.groovy @@ -17,6 +17,18 @@ * under the License. */ -assert ! new File( basedir, "target/repo" ).exists() -assert new File( basedir, "module1/target/repo/org/apache/maven/its/mdeploy-225/module1/1.0/module1-1.0.pom" ).exists() -assert new File( basedir, "module2/target/repo/org/apache/maven/its/mdeploy-225/module2/1.0/module2-1.0.pom" ).exists() +rootRepo = new File( basedir, "target/repo" ) +module1Repo = new File( basedir, "module1/target/repo" ) +module2Repo = new File( basedir, "module2/target/repo" ) + +if (mavenVersion.startsWith('4.')) { + // Maven 4 deploys in the root target directory, as defined in the root POM (even if not deployed) + module1Repo = module2Repo = rootRepo +} else { + // Maven 3 deploys in the each module target directory, nothing in root + assert ! rootRepo.exists() +} + +// check that files are deployed both by Maven 3 and 4 = https://github.com/apache/maven-deploy-plugin/issues/533 +assert new File( module1Repo, "org/apache/maven/its/mdeploy-225/module1/1.0/module1-1.0.pom" ).exists() +assert new File( module2Repo, "org/apache/maven/its/mdeploy-225/module2/1.0/module2-1.0.pom" ).exists()