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 fe698d3200..9faae05c29 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 { + 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 336c583fd3..4c6eec7dae 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 4f8d414ef8..ce90d69bbc 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 207d4ad655..05bfe98f99 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 520bd0a1c7..82e1a40579 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 c6e0e8aae4..3237e3c76e 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 d77ddabda7..0d85e96340 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 9e93531f94..33f2290b50 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