You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by cs...@apache.org on 2022/07/12 13:14:00 UTC

[maven] branch master updated: Pull out lifecycle plugin versions (#766)

This is an automated email from the ASF dual-hosted git repository.

cstamas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven.git


The following commit(s) were added to refs/heads/master by this push:
     new f05397a88 Pull out lifecycle plugin versions (#766)
f05397a88 is described below

commit f05397a88dc4178fff7ac7d307797cd54db3bef9
Author: Tamas Cservenak <ta...@cservenak.net>
AuthorDate: Tue Jul 12 15:13:55 2022 +0200

    Pull out lifecycle plugin versions (#766)
    
    To lessen mistake (copy-paste vs forgotten update) but also just to
    make things less redundant. This also makes possible "experimenting"
    much more easier.
    
    This is merely a refactoring that does not takes or gives anything, just tidies up.
---
 .../AbstractLifecycleMappingProvider.java          | 24 ++++++++++++++++++++++
 .../packaging/EarLifecycleMappingProvider.java     | 11 +++++-----
 .../packaging/EjbLifecycleMappingProvider.java     | 17 +++++++--------
 .../packaging/JarLifecycleMappingProvider.java     | 17 +++++++--------
 .../MavenPluginLifecycleMappingProvider.java       | 21 ++++++++++---------
 .../packaging/PomLifecycleMappingProvider.java     |  5 +++--
 .../packaging/RarLifecycleMappingProvider.java     | 17 +++++++--------
 .../packaging/WarLifecycleMappingProvider.java     | 17 +++++++--------
 8 files changed, 80 insertions(+), 49 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/AbstractLifecycleMappingProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/AbstractLifecycleMappingProvider.java
index fe698d320..9faae05c2 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/AbstractLifecycleMappingProvider.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/AbstractLifecycleMappingProvider.java
@@ -37,6 +37,30 @@ import static java.util.Objects.requireNonNull;
 public abstract class AbstractLifecycleMappingProvider
     implements Provider<LifecycleMapping>
 {
+    protected static final String RESOURCES_PLUGIN_VERSION = "3.2.0";
+
+    protected static final String COMPILER_PLUGIN_VERSION = "3.8.1";
+
+    protected static final String SUREFIRE_PLUGIN_VERSION = "3.0.0-M5";
+
+    protected static final String INSTALL_PLUGIN_VERSION = "3.0.0-M1";
+
+    protected static final String DEPLOY_PLUGIN_VERSION = "3.0.0-M2";
+
+    // packaging
+
+    protected static final String JAR_PLUGIN_VERSION = "3.2.0";
+
+    protected static final String EAR_PLUGIN_VERSION = "3.1.2";
+
+    protected static final String EJB_PLUGIN_VERSION = "3.1.0";
+
+    protected static final String PLUGIN_PLUGIN_VERSION = "3.6.0";
+
+    protected static final String RAR_PLUGIN_VERSION = "2.4"; // TODO: Update!!!
+
+    protected static final String WAR_PLUGIN_VERSION = "3.3.1";
+
     private final LifecycleMapping lifecycleMapping;
 
     protected AbstractLifecycleMappingProvider( String[] pluginBindings )
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/EarLifecycleMappingProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/EarLifecycleMappingProvider.java
index 336c583fd..4c6eec7da 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/EarLifecycleMappingProvider.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/EarLifecycleMappingProvider.java
@@ -32,13 +32,14 @@ public final class EarLifecycleMappingProvider
     extends AbstractLifecycleMappingProvider
 {
     // START SNIPPET: ear
+    @SuppressWarnings( "checkstyle:linelength" )
     private static final String[] BINDINGS =
     {
-        "generate-resources", "org.apache.maven.plugins:maven-ear-plugin:3.1.2:generate-application-xml",
-        "process-resources",  "org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources",
-        "package",            "org.apache.maven.plugins:maven-ear-plugin:3.1.2:ear",
-        "install",            "org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install",
-        "deploy",             "org.apache.maven.plugins:maven-deploy-plugin:3.0.0-M1:deploy"
+        "generate-resources", "org.apache.maven.plugins:maven-ear-plugin:" + EAR_PLUGIN_VERSION + ":generate-application-xml",
+        "process-resources",  "org.apache.maven.plugins:maven-resources-plugin:" + RESOURCES_PLUGIN_VERSION + ":resources",
+        "package",            "org.apache.maven.plugins:maven-ear-plugin:" + EAR_PLUGIN_VERSION + ":ear",
+        "install",            "org.apache.maven.plugins:maven-install-plugin:" + INSTALL_PLUGIN_VERSION + ":install",
+        "deploy",             "org.apache.maven.plugins:maven-deploy-plugin:" + DEPLOY_PLUGIN_VERSION + ":deploy"
     };
     // END SNIPPET: ear
 
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/EjbLifecycleMappingProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/EjbLifecycleMappingProvider.java
index 4f8d414ef..ce90d69bb 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/EjbLifecycleMappingProvider.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/EjbLifecycleMappingProvider.java
@@ -32,16 +32,17 @@ public final class EjbLifecycleMappingProvider
     extends AbstractLifecycleMappingProvider
 {
     // START SNIPPET: ejb
+    @SuppressWarnings( "checkstyle:linelength" )
     private static final String[] BINDINGS =
     {
-        "process-resources",      "org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources",
-        "compile",                "org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile",
-        "process-test-resources", "org.apache.maven.plugins:maven-resources-plugin:3.2.0:testResources",
-        "test-compile",           "org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile",
-        "test",                   "org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test",
-        "package",                "org.apache.maven.plugins:maven-ejb-plugin:3.1.0:ejb",
-        "install",                "org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install",
-        "deploy",                 "org.apache.maven.plugins:maven-deploy-plugin:3.0.0-M1:deploy"
+        "process-resources",      "org.apache.maven.plugins:maven-resources-plugin:" + RESOURCES_PLUGIN_VERSION + ":resources",
+        "compile",                "org.apache.maven.plugins:maven-compiler-plugin:" + COMPILER_PLUGIN_VERSION + ":compile",
+        "process-test-resources", "org.apache.maven.plugins:maven-resources-plugin:" + RESOURCES_PLUGIN_VERSION + ":testResources",
+        "test-compile",           "org.apache.maven.plugins:maven-compiler-plugin:" + COMPILER_PLUGIN_VERSION + ":testCompile",
+        "test",                   "org.apache.maven.plugins:maven-surefire-plugin:" + SUREFIRE_PLUGIN_VERSION + ":test",
+        "package",                "org.apache.maven.plugins:maven-ejb-plugin:" + EJB_PLUGIN_VERSION + ":ejb",
+        "install",                "org.apache.maven.plugins:maven-install-plugin:" + INSTALL_PLUGIN_VERSION + ":install",
+        "deploy",                 "org.apache.maven.plugins:maven-deploy-plugin:" + DEPLOY_PLUGIN_VERSION + ":deploy"
     };
     // END SNIPPET: ejb
     
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/JarLifecycleMappingProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/JarLifecycleMappingProvider.java
index 207d4ad65..05bfe98f9 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/JarLifecycleMappingProvider.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/JarLifecycleMappingProvider.java
@@ -32,16 +32,17 @@ public final class JarLifecycleMappingProvider
     extends AbstractLifecycleMappingProvider
 {
     // START SNIPPET: jar
+    @SuppressWarnings( "checkstyle:linelength" )
     private static final String[] BINDINGS =
     {
-        "process-resources",      "org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources",
-        "compile",                "org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile",
-        "process-test-resources", "org.apache.maven.plugins:maven-resources-plugin:3.2.0:testResources",
-        "test-compile",           "org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile",
-        "test",                   "org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test",
-        "package",                "org.apache.maven.plugins:maven-jar-plugin:3.2.0:jar",
-        "install",                "org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install",
-        "deploy",                 "org.apache.maven.plugins:maven-deploy-plugin:3.0.0-M1:deploy"
+        "process-resources",      "org.apache.maven.plugins:maven-resources-plugin:" + RESOURCES_PLUGIN_VERSION + ":resources",
+        "compile",                "org.apache.maven.plugins:maven-compiler-plugin:" + COMPILER_PLUGIN_VERSION + ":compile",
+        "process-test-resources", "org.apache.maven.plugins:maven-resources-plugin:" + RESOURCES_PLUGIN_VERSION + ":testResources",
+        "test-compile",           "org.apache.maven.plugins:maven-compiler-plugin:" + COMPILER_PLUGIN_VERSION + ":testCompile",
+        "test",                   "org.apache.maven.plugins:maven-surefire-plugin:" + SUREFIRE_PLUGIN_VERSION + ":test",
+        "package",                "org.apache.maven.plugins:maven-jar-plugin:" + JAR_PLUGIN_VERSION + ":jar",
+        "install",                "org.apache.maven.plugins:maven-install-plugin:" + INSTALL_PLUGIN_VERSION + ":install",
+        "deploy",                 "org.apache.maven.plugins:maven-deploy-plugin:" + DEPLOY_PLUGIN_VERSION + ":deploy"
     };
     // END SNIPPET: jar
     
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/MavenPluginLifecycleMappingProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/MavenPluginLifecycleMappingProvider.java
index 520bd0a1c..82e1a4057 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/MavenPluginLifecycleMappingProvider.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/MavenPluginLifecycleMappingProvider.java
@@ -32,18 +32,19 @@ public final class MavenPluginLifecycleMappingProvider
     extends AbstractLifecycleMappingProvider
 {
     // START SNIPPET: maven-plugin
+    @SuppressWarnings( "checkstyle:linelength" )
     private static final String[] BINDINGS =
     {
-        "process-resources",      "org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources",
-        "compile",                "org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile",
-        "process-classes",        "org.apache.maven.plugins:maven-plugin-plugin:3.6.0:descriptor",
-        "process-test-resources", "org.apache.maven.plugins:maven-resources-plugin:3.2.0:testResources",
-        "test-compile",           "org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile",
-        "test",                   "org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test",
-        "package",                "org.apache.maven.plugins:maven-jar-plugin:3.2.0:jar,"
-                                + "org.apache.maven.plugins:maven-plugin-plugin:3.6.0:addPluginArtifactMetadata",
-        "install",                "org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install",
-        "deploy",                 "org.apache.maven.plugins:maven-deploy-plugin:3.0.0-M1:deploy"
+        "process-resources",      "org.apache.maven.plugins:maven-resources-plugin:" + RESOURCES_PLUGIN_VERSION + ":resources",
+        "compile",                "org.apache.maven.plugins:maven-compiler-plugin:" + COMPILER_PLUGIN_VERSION + ":compile",
+        "process-classes",        "org.apache.maven.plugins:maven-plugin-plugin:" + PLUGIN_PLUGIN_VERSION + ":descriptor",
+        "process-test-resources", "org.apache.maven.plugins:maven-resources-plugin:" + RESOURCES_PLUGIN_VERSION + ":testResources",
+        "test-compile",           "org.apache.maven.plugins:maven-compiler-plugin:" + COMPILER_PLUGIN_VERSION + ":testCompile",
+        "test",                   "org.apache.maven.plugins:maven-surefire-plugin:" + SUREFIRE_PLUGIN_VERSION + ":test",
+        "package",                "org.apache.maven.plugins:maven-jar-plugin:" + JAR_PLUGIN_VERSION + ":jar,"
+                                + "org.apache.maven.plugins:maven-plugin-plugin:" + PLUGIN_PLUGIN_VERSION + ":addPluginArtifactMetadata",
+        "install",                "org.apache.maven.plugins:maven-install-plugin:" + INSTALL_PLUGIN_VERSION + ":install",
+        "deploy",                 "org.apache.maven.plugins:maven-deploy-plugin:" + DEPLOY_PLUGIN_VERSION + ":deploy"
     };
     // END SNIPPET: maven-plugin
     
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/PomLifecycleMappingProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/PomLifecycleMappingProvider.java
index c6e0e8aae..3237e3c76 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/PomLifecycleMappingProvider.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/PomLifecycleMappingProvider.java
@@ -32,10 +32,11 @@ public final class PomLifecycleMappingProvider
     extends AbstractLifecycleMappingProvider
 {
     // START SNIPPET: pom
+    @SuppressWarnings( "checkstyle:linelength" )
     private static final String[] BINDINGS =
     {
-        "install", "org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install",
-        "deploy",  "org.apache.maven.plugins:maven-deploy-plugin:3.0.0-M1:deploy"
+        "install", "org.apache.maven.plugins:maven-install-plugin:" + INSTALL_PLUGIN_VERSION + ":install",
+        "deploy",  "org.apache.maven.plugins:maven-deploy-plugin:" + DEPLOY_PLUGIN_VERSION + ":deploy"
     };
     // END SNIPPET: pom
     
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/RarLifecycleMappingProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/RarLifecycleMappingProvider.java
index d77ddabda..0d85e9634 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/RarLifecycleMappingProvider.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/RarLifecycleMappingProvider.java
@@ -32,16 +32,17 @@ public final class RarLifecycleMappingProvider
     extends AbstractLifecycleMappingProvider
 {
     // START SNIPPET: rar
+    @SuppressWarnings( "checkstyle:linelength" )
     private static final String[] BINDINGS =
     {
-        "process-resources",      "org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources",
-        "compile",                "org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile",
-        "process-test-resources", "org.apache.maven.plugins:maven-resources-plugin:3.2.0:testResources",
-        "test-compile",           "org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile",
-        "test",                   "org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test",
-        "package",                "org.apache.maven.plugins:maven-rar-plugin:2.4:rar",
-        "install",                "org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install",
-        "deploy",                 "org.apache.maven.plugins:maven-deploy-plugin:3.0.0-M1:deploy"
+        "process-resources",      "org.apache.maven.plugins:maven-resources-plugin:" + RESOURCES_PLUGIN_VERSION + ":resources",
+        "compile",                "org.apache.maven.plugins:maven-compiler-plugin:" + COMPILER_PLUGIN_VERSION + ":compile",
+        "process-test-resources", "org.apache.maven.plugins:maven-resources-plugin:" + RESOURCES_PLUGIN_VERSION + ":testResources",
+        "test-compile",           "org.apache.maven.plugins:maven-compiler-plugin:" + COMPILER_PLUGIN_VERSION + ":testCompile",
+        "test",                   "org.apache.maven.plugins:maven-surefire-plugin:" + SUREFIRE_PLUGIN_VERSION + ":test",
+        "package",                "org.apache.maven.plugins:maven-rar-plugin:" + RAR_PLUGIN_VERSION + ":rar",
+        "install",                "org.apache.maven.plugins:maven-install-plugin:" + INSTALL_PLUGIN_VERSION + ":install",
+        "deploy",                 "org.apache.maven.plugins:maven-deploy-plugin:" + DEPLOY_PLUGIN_VERSION + ":deploy"
     };
     // END SNIPPET: rar
     
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/WarLifecycleMappingProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/WarLifecycleMappingProvider.java
index 9e93531f9..33f2290b5 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/WarLifecycleMappingProvider.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/WarLifecycleMappingProvider.java
@@ -32,16 +32,17 @@ public final class WarLifecycleMappingProvider
     extends AbstractLifecycleMappingProvider
 {
     // START SNIPPET: war
+    @SuppressWarnings( "checkstyle:linelength" )
     private static final String[] BINDINGS =
     {
-        "process-resources",      "org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources",
-        "compile",                "org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile",
-        "process-test-resources", "org.apache.maven.plugins:maven-resources-plugin:3.2.0:testResources",
-        "test-compile",           "org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile",
-        "test",                   "org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test",
-        "package",                "org.apache.maven.plugins:maven-war-plugin:3.3.1:war",
-        "install",                "org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install",
-        "deploy",                 "org.apache.maven.plugins:maven-deploy-plugin:3.0.0-M1:deploy"
+        "process-resources",      "org.apache.maven.plugins:maven-resources-plugin:" + RESOURCES_PLUGIN_VERSION + ":resources",
+        "compile",                "org.apache.maven.plugins:maven-compiler-plugin:" + COMPILER_PLUGIN_VERSION + ":compile",
+        "process-test-resources", "org.apache.maven.plugins:maven-resources-plugin:" + RESOURCES_PLUGIN_VERSION + ":testResources",
+        "test-compile",           "org.apache.maven.plugins:maven-compiler-plugin:" + COMPILER_PLUGIN_VERSION + ":testCompile",
+        "test",                   "org.apache.maven.plugins:maven-surefire-plugin:" + SUREFIRE_PLUGIN_VERSION + ":test",
+        "package",                "org.apache.maven.plugins:maven-war-plugin:" + WAR_PLUGIN_VERSION + ":war",
+        "install",                "org.apache.maven.plugins:maven-install-plugin:" + INSTALL_PLUGIN_VERSION + ":install",
+        "deploy",                 "org.apache.maven.plugins:maven-deploy-plugin:" + DEPLOY_PLUGIN_VERSION + ":deploy"
     };
     // END SNIPPET: war