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.
This commit is contained in:
Tamas Cservenak 2022-07-12 15:13:55 +02:00 committed by GitHub
parent 90c084dcf4
commit f05397a88d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 80 additions and 49 deletions

View File

@ -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 )

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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