diff --git a/maven-release-api/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptor.java b/maven-release-api/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptor.java index ed653c746..976a0f569 100644 --- a/maven-release-api/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptor.java +++ b/maven-release-api/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptor.java @@ -426,7 +426,7 @@ public interface ReleaseDescriptor { /** * Get the (optional) config for the VersionPolicy implementation used to calculate the project versions. * - * @return The parsed XML of the provided config (an instance of XmlPlexusConfiguration) or null. + * @return The parsed XML of the provided config (an instance of PlexusConfiguration) or null. */ Object getProjectVersionPolicyConfig(); diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java index af4dd4624..1261b2547 100644 --- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java +++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java @@ -543,9 +543,10 @@ private List createReleasePlugins(ReleaseDescriptor releaseDescriptor, M } releasePlugin.setExecutions(plugin.getExecutions()); releasePlugin.setDependencies(plugin.getDependencies()); - releasePlugin.setGoals(plugin.getGoals()); releasePlugin.setInherited(plugin.getInherited()); - releasePlugin.setConfiguration(plugin.getConfiguration()); + if (plugin.getConfiguration() != null) { + releasePlugin.setConfiguration(plugin.getConfiguration()); + } releasePlugins.add(releasePlugin); } diff --git a/maven-release-plugin/pom.xml b/maven-release-plugin/pom.xml index 7fa64ef0e..3cda4db19 100644 --- a/maven-release-plugin/pom.xml +++ b/maven-release-plugin/pom.xml @@ -209,6 +209,7 @@ org.apache.maven.plugins maven-invoker-plugin + 3.5.1 src/it ${project.build.directory}/it diff --git a/maven-release-plugin/src/it/projects/branch/MRELEASE-458/pom.xml b/maven-release-plugin/src/it/projects/branch/MRELEASE-458/pom.xml index 1dbd1b2a1..c3573b4bb 100644 --- a/maven-release-plugin/src/it/projects/branch/MRELEASE-458/pom.xml +++ b/maven-release-plugin/src/it/projects/branch/MRELEASE-458/pom.xml @@ -61,6 +61,7 @@ maven-release-plugin + @project.version@ false true diff --git a/maven-release-plugin/src/it/projects/branch/MRELEASE-694/verify.groovy b/maven-release-plugin/src/it/projects/branch/MRELEASE-694/verify.groovy index 8d7f901c8..663166f1a 100644 --- a/maven-release-plugin/src/it/projects/branch/MRELEASE-694/verify.groovy +++ b/maven-release-plugin/src/it/projects/branch/MRELEASE-694/verify.groovy @@ -18,6 +18,8 @@ * under the License. */ +import groovy.xml.XmlSlurper + def projectBranch = new XmlSlurper().parse( new File( basedir, "pom.xml.branch" ) ) assert projectBranch.version.text() == "2.6.0-BRANCH-SNAPSHOT" diff --git a/maven-release-plugin/src/it/projects/branch/MRELEASE-745/pom.xml b/maven-release-plugin/src/it/projects/branch/MRELEASE-745/pom.xml index 4fe5757b9..c0fb1e5d3 100644 --- a/maven-release-plugin/src/it/projects/branch/MRELEASE-745/pom.xml +++ b/maven-release-plugin/src/it/projects/branch/MRELEASE-745/pom.xml @@ -31,6 +31,8 @@ maven-release-plugin + + 2.5.3 true branch-mrelease-745 diff --git a/maven-release-plugin/src/it/projects/branch/MRELEASE-976/verify.groovy b/maven-release-plugin/src/it/projects/branch/MRELEASE-976/verify.groovy index 04ff692a3..b7de67c33 100644 --- a/maven-release-plugin/src/it/projects/branch/MRELEASE-976/verify.groovy +++ b/maven-release-plugin/src/it/projects/branch/MRELEASE-976/verify.groovy @@ -18,6 +18,8 @@ * under the License. */ +import groovy.xml.XmlSlurper + def project = new XmlSlurper().parse( new File( basedir, "pom.xml" ) ) assert project.version.text() == "1.0-SNAPSHOT" diff --git a/maven-release-plugin/src/it/projects/perform/MRELEASE-592/pom.xml b/maven-release-plugin/src/it/projects/perform/MRELEASE-592/pom.xml index 77e304eaf..32c47aa1d 100644 --- a/maven-release-plugin/src/it/projects/perform/MRELEASE-592/pom.xml +++ b/maven-release-plugin/src/it/projects/perform/MRELEASE-592/pom.xml @@ -66,7 +66,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 1.1.1 + @mavenEnforcerPluginVersion@ enforce @@ -94,7 +94,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 1.1.1 + @mavenEnforcerPluginVersion@ enforce diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/verify.groovy b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/verify.groovy index f496ed480..e12d0e578 100644 --- a/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/verify.groovy +++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1053/verify.groovy @@ -17,6 +17,8 @@ * under the License. */ +import groovy.xml.XmlSlurper + // check parent project def project = new XmlSlurper().parse( new File( new File ( basedir, 'module-parent' ), 'pom.xml.next' ) ) assert project.version.text() == '1.1-SNAPSHOT' diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-1077/pom.xml b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1077/pom.xml index 807c401d6..478902fa0 100644 --- a/maven-release-plugin/src/it/projects/prepare/MRELEASE-1077/pom.xml +++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1077/pom.xml @@ -51,7 +51,7 @@ org.apache.maven.plugins maven-help-plugin - 3.3.0 + @mavenHelpPluginVersion@ Show profiles diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-1077/verify.groovy b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1077/verify.groovy index a0e52dc92..563380f88 100644 --- a/maven-release-plugin/src/it/projects/prepare/MRELEASE-1077/verify.groovy +++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-1077/verify.groovy @@ -20,5 +20,5 @@ File buildLog = new File( basedir, 'build.log' ) assert buildLog.exists() -assert buildLog.text.contains( "[INFO] - PrepProfA (source: org.apache.maven.plugin.release.its:mrelease-1077:1.0-SNAPSHOT)") -assert buildLog.text.contains( "[INFO] - PrepProfB (source: org.apache.maven.plugin.release.its:mrelease-1077:1.0-SNAPSHOT)") +assert buildLog.text.contains( "[INFO] - PrepProfA (source: ") +assert buildLog.text.contains( "[INFO] - PrepProfB (source: ") diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-161-dependencyManagement/verify.groovy b/maven-release-plugin/src/it/projects/prepare/MRELEASE-161-dependencyManagement/verify.groovy index ec4071365..f978353ee 100644 --- a/maven-release-plugin/src/it/projects/prepare/MRELEASE-161-dependencyManagement/verify.groovy +++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-161-dependencyManagement/verify.groovy @@ -18,6 +18,9 @@ * under the License. */ +import groovy.xml.XmlSlurper + + File buildLog = new File( basedir, 'build.log' ) assert buildLog.exists() diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-161/verify.groovy b/maven-release-plugin/src/it/projects/prepare/MRELEASE-161/verify.groovy index 3718c5488..137070997 100644 --- a/maven-release-plugin/src/it/projects/prepare/MRELEASE-161/verify.groovy +++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-161/verify.groovy @@ -18,6 +18,8 @@ * under the License. */ +import groovy.xml.XmlSlurper + File buildLog = new File( basedir, 'build.log' ) assert buildLog.exists() diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-571_M3/module1/pom.xml b/maven-release-plugin/src/it/projects/prepare/MRELEASE-571_M3/module1/pom.xml index 902a69ae2..2d41bead5 100644 --- a/maven-release-plugin/src/it/projects/prepare/MRELEASE-571_M3/module1/pom.xml +++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-571_M3/module1/pom.xml @@ -40,7 +40,7 @@ under the License. org.apache.maven.plugins maven-enforcer-plugin - 1.0.1 + @mavenEnforcerPluginVersion@ @@ -64,7 +64,7 @@ under the License. org.apache.maven.plugins maven-enforcer-plugin - 1.0.1 + @mavenEnforcerPluginVersion@ diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-667/pom.xml b/maven-release-plugin/src/it/projects/prepare/MRELEASE-667/pom.xml index 216c5555c..205860a67 100644 --- a/maven-release-plugin/src/it/projects/prepare/MRELEASE-667/pom.xml +++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-667/pom.xml @@ -37,14 +37,14 @@ - -Prelease,!mrelease-677 ${arguments} + -P!mrelease-677 ${arguments} help:all-profiles org.apache.maven.plugins maven-help-plugin - 2.1.1 + @mavenHelpPluginVersion@ diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-667/verify.groovy b/maven-release-plugin/src/it/projects/prepare/MRELEASE-667/verify.groovy index bd42e6d58..215d58ef9 100644 --- a/maven-release-plugin/src/it/projects/prepare/MRELEASE-667/verify.groovy +++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-667/verify.groovy @@ -24,5 +24,5 @@ assert buildLog.exists() // Can only be checked with M3 //assert 1 == buildLog.getText().count("[DEBUG] Profile with id: 'mrelease-677' has been explicitly activated.") -assert 1 == buildLog.getText().count(" Profile Id: mrelease-677 (Active: false , Source: settings.xml)") +assert 1 == buildLog.getText().count(" Profile Id: mrelease-677 (Active: false, Source: settings.xml)") assert buildLog.getText().contains("[WARNING] arguments parameter contains unresolved property: '\${arguments}'") diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-976/verify.groovy b/maven-release-plugin/src/it/projects/prepare/MRELEASE-976/verify.groovy index 1a947573f..bd1a9e415 100644 --- a/maven-release-plugin/src/it/projects/prepare/MRELEASE-976/verify.groovy +++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-976/verify.groovy @@ -18,6 +18,8 @@ * under the License. */ +import groovy.xml.XmlSlurper + def project = new XmlSlurper().parse( new File( basedir, "pom.xml" ) ) assert project.version.text() == "1.0-SNAPSHOT" diff --git a/maven-release-plugin/src/it/projects/prepare/MRELEASE-985/verify.groovy b/maven-release-plugin/src/it/projects/prepare/MRELEASE-985/verify.groovy index 4e05fc8f7..bbd0de781 100644 --- a/maven-release-plugin/src/it/projects/prepare/MRELEASE-985/verify.groovy +++ b/maven-release-plugin/src/it/projects/prepare/MRELEASE-985/verify.groovy @@ -18,6 +18,8 @@ * under the License. */ +import groovy.xml.XmlSlurper + def project = new XmlSlurper().parse( new File( basedir, "pom.xml" ) ) assert project.version.text() == "1.0-SNAPSHOT" assert project.parent.version.text() == "1-SNAPSHOT" diff --git a/maven-release-plugin/src/it/projects/prepare/namespace/verify.groovy b/maven-release-plugin/src/it/projects/prepare/namespace/verify.groovy index da22596b3..b7aff067b 100644 --- a/maven-release-plugin/src/it/projects/prepare/namespace/verify.groovy +++ b/maven-release-plugin/src/it/projects/prepare/namespace/verify.groovy @@ -17,6 +17,8 @@ * under the License. */ +import groovy.xml.XmlSlurper + def project = new XmlSlurper().parse( new File( basedir, "pom.xml" ) ) assert project['@xsi:schemaLocation'] == "http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd" diff --git a/maven-release-plugin/src/it/projects/prepare/version-policy/verify.groovy b/maven-release-plugin/src/it/projects/prepare/version-policy/verify.groovy index 9426c2a6d..f80703a54 100644 --- a/maven-release-plugin/src/it/projects/prepare/version-policy/verify.groovy +++ b/maven-release-plugin/src/it/projects/prepare/version-policy/verify.groovy @@ -17,6 +17,8 @@ * under the License. */ +import groovy.xml.XmlSlurper + File buildLog = new File( basedir, 'build.log' ) assert buildLog.exists() diff --git a/maven-release-plugin/src/it/projects/update-versions/MRELEASE-555/verify.groovy b/maven-release-plugin/src/it/projects/update-versions/MRELEASE-555/verify.groovy index e1d930373..e1a034c0c 100644 --- a/maven-release-plugin/src/it/projects/update-versions/MRELEASE-555/verify.groovy +++ b/maven-release-plugin/src/it/projects/update-versions/MRELEASE-555/verify.groovy @@ -18,6 +18,8 @@ * under the License. */ +import groovy.xml.XmlSlurper + File buildLog = new File( basedir, 'build.log' ) assert buildLog.exists() diff --git a/maven-release-plugin/src/it/projects/update-versions/MRELEASE-611/verify.groovy b/maven-release-plugin/src/it/projects/update-versions/MRELEASE-611/verify.groovy index 369c62546..46b1bd0dd 100644 --- a/maven-release-plugin/src/it/projects/update-versions/MRELEASE-611/verify.groovy +++ b/maven-release-plugin/src/it/projects/update-versions/MRELEASE-611/verify.groovy @@ -18,6 +18,8 @@ * under the License. */ +import groovy.xml.XmlSlurper + File buildLog = new File( basedir, 'build.log' ) assert buildLog.exists() diff --git a/maven-release-plugin/src/it/projects/update-versions/MRELEASE-976/verify.groovy b/maven-release-plugin/src/it/projects/update-versions/MRELEASE-976/verify.groovy index 350012e31..7691e43dc 100644 --- a/maven-release-plugin/src/it/projects/update-versions/MRELEASE-976/verify.groovy +++ b/maven-release-plugin/src/it/projects/update-versions/MRELEASE-976/verify.groovy @@ -18,6 +18,8 @@ * under the License. */ +import groovy.xml.XmlSlurper + // verifies that the version is unchanged because of the custom policy: 1.0-SNAPSHOT -> 1.0 -> 1.0-SNAPSHOT def project = new XmlSlurper().parse( new File( basedir, "pom.xml" ) ) assert project.version.text() == "1.0-SNAPSHOT" diff --git a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/BranchReleaseMojo.java b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/BranchReleaseMojo.java index b9d50628a..db314c4b0 100644 --- a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/BranchReleaseMojo.java +++ b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/BranchReleaseMojo.java @@ -29,7 +29,7 @@ import org.apache.maven.shared.release.ReleaseExecutionException; import org.apache.maven.shared.release.ReleaseFailureException; import org.apache.maven.shared.release.config.ReleaseDescriptorBuilder; -import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration; +import org.codehaus.plexus.configuration.PlexusConfiguration; /** * Branch a project in SCM, using the same steps as the release:prepare goal, creating a branch instead of @@ -204,7 +204,7 @@ public class BranchReleaseMojo extends AbstractScmReleaseMojo { * @since 3.0.0 */ @Parameter(property = "projectVersionPolicyConfig") - private XmlPlexusConfiguration projectVersionPolicyConfig; + private PlexusConfiguration projectVersionPolicyConfig; /** * The role-hint for the {@link org.apache.maven.shared.release.policy.naming.NamingPolicy} diff --git a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java index ff2bb8d87..58a4cc354 100644 --- a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java +++ b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java @@ -33,7 +33,7 @@ import org.apache.maven.shared.release.ReleaseFailureException; import org.apache.maven.shared.release.ReleasePrepareRequest; import org.apache.maven.shared.release.config.ReleaseDescriptorBuilder; -import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration; +import org.codehaus.plexus.configuration.PlexusConfiguration; /** * Prepare for a release in SCM. Steps through several phases to ensure the POM is ready to be released and then @@ -250,7 +250,7 @@ public class PrepareReleaseMojo extends AbstractScmReleaseMojo { * @since 3.0.0 */ @Parameter(property = "projectVersionPolicyConfig") - private XmlPlexusConfiguration projectVersionPolicyConfig; + private PlexusConfiguration projectVersionPolicyConfig; /** * The role-hint for the {@link org.apache.maven.shared.release.policy.naming.NamingPolicy} diff --git a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/UpdateVersionsMojo.java b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/UpdateVersionsMojo.java index 253cf1b50..caf9acd93 100644 --- a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/UpdateVersionsMojo.java +++ b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/UpdateVersionsMojo.java @@ -28,7 +28,7 @@ import org.apache.maven.shared.release.ReleaseFailureException; import org.apache.maven.shared.release.ReleaseUpdateVersionsRequest; import org.apache.maven.shared.release.config.ReleaseDescriptorBuilder; -import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration; +import org.codehaus.plexus.configuration.PlexusConfiguration; /** * Update the POM versions for a project. This performs the normal version updates of the release:prepare @@ -97,7 +97,7 @@ public class UpdateVersionsMojo extends AbstractReleaseMojo { * @since 3.0.0 */ @Parameter(property = "projectVersionPolicyConfig") - private XmlPlexusConfiguration projectVersionPolicyConfig; + private PlexusConfiguration projectVersionPolicyConfig; @Override public void execute() throws MojoExecutionException, MojoFailureException { diff --git a/pom.xml b/pom.xml index 337a1947a..b7b45a346 100644 --- a/pom.xml +++ b/pom.xml @@ -102,6 +102,8 @@ 3.11.0 3.5.0 + 3.3.0 + 3.4.0