diff --git a/pom.xml b/pom.xml index ca49d4c69a..3c6f9fb14f 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ under the License. org.apache.maven.plugins maven-plugins - 43 + 44 @@ -254,6 +254,7 @@ under the License. org.apache.maven.plugin-tools maven-plugin-annotations + ${version.maven-plugin-tools} provided diff --git a/src/test/java/org/apache/maven/plugins/dependency/TestCollectMojo.java b/src/test/java/org/apache/maven/plugins/dependency/TestCollectMojo.java index 9e86c813a0..71fb6a03c5 100644 --- a/src/test/java/org/apache/maven/plugins/dependency/TestCollectMojo.java +++ b/src/test/java/org/apache/maven/plugins/dependency/TestCollectMojo.java @@ -74,7 +74,7 @@ public void testCollectTestEnvironment() throws Exception { * * @throws Exception if a problem occurs */ - public void testCollectTestEnvironment_excludeTransitive() throws Exception { + public void testCollectTestEnvironmentExcludeTransitive() throws Exception { File testPom = new File(getBasedir(), "target/test-classes/unit/collect-test/plugin-config.xml"); CollectDependenciesMojo mojo = (CollectDependenciesMojo) lookupMojo("collect", testPom); diff --git a/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestIncludeExcludeUnpackMojo.java b/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestIncludeExcludeUnpackMojo.java index 02c3644c8f..c930cda29f 100644 --- a/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestIncludeExcludeUnpackMojo.java +++ b/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestIncludeExcludeUnpackMojo.java @@ -33,13 +33,13 @@ import org.apache.maven.project.MavenProject; public class TestIncludeExcludeUnpackMojo extends AbstractDependencyMojoTestCase { - private final String PACKED_FILE = "test.zip"; + private static final String PACKED_FILE = "test.zip"; - private final String UNPACKED_FILE_PREFIX = "test"; + private static final String UNPACKED_FILE_PREFIX = "test"; - private final String UNPACKED_FILE_SUFFIX = ".txt"; + private static final String UNPACKED_FILE_SUFFIX = ".txt"; - private final String PACKED_FILE_PATH = "target/test-classes/unit/unpack-dependencies-test/" + PACKED_FILE; + private static final String PACKED_FILE_PATH = "target/test-classes/unit/unpack-dependencies-test/" + PACKED_FILE; private UnpackMojo mojo; diff --git a/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestIncludeExcludeUnpackDependenciesMojo.java b/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestIncludeExcludeUnpackDependenciesMojo.java index 0617b87557..e59b042e96 100644 --- a/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestIncludeExcludeUnpackDependenciesMojo.java +++ b/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestIncludeExcludeUnpackDependenciesMojo.java @@ -28,13 +28,13 @@ import org.apache.maven.project.MavenProject; public class TestIncludeExcludeUnpackDependenciesMojo extends AbstractDependencyMojoTestCase { - private final String PACKED_FILE = "test.zip"; + private static final String PACKED_FILE = "test.zip"; - private final String UNPACKED_FILE_PREFIX = "test"; + private static final String UNPACKED_FILE_PREFIX = "test"; - private final String UNPACKED_FILE_SUFFIX = ".txt"; + private static final String UNPACKED_FILE_SUFFIX = ".txt"; - private final String PACKED_FILE_PATH = "target/test-classes/unit/unpack-dependencies-test/" + PACKED_FILE; + private static final String PACKED_FILE_PATH = "target/test-classes/unit/unpack-dependencies-test/" + PACKED_FILE; private UnpackDependenciesMojo mojo; diff --git a/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestUnpackDependenciesMojo.java b/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestUnpackDependenciesMojo.java index 9c913e2aef..1ad120f46f 100644 --- a/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestUnpackDependenciesMojo.java +++ b/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestUnpackDependenciesMojo.java @@ -43,9 +43,10 @@ public class TestUnpackDependenciesMojo extends AbstractDependencyMojoTestCase { - private final String UNPACKABLE_FILE = "test.txt"; + private static final String UNPACKABLE_FILE = "test.txt"; - private final String UNPACKABLE_FILE_PATH = "target/test-classes/unit/unpack-dependencies-test/" + UNPACKABLE_FILE; + private static final String UNPACKABLE_FILE_PATH = + "target/test-classes/unit/unpack-dependencies-test/" + UNPACKABLE_FILE; UnpackDependenciesMojo mojo; diff --git a/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestUnpackDependenciesMojo2.java b/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestUnpackDependenciesMojo2.java index 27e43c9fcc..85d85e1173 100644 --- a/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestUnpackDependenciesMojo2.java +++ b/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestUnpackDependenciesMojo2.java @@ -36,9 +36,10 @@ public class TestUnpackDependenciesMojo2 extends AbstractDependencyMojoTestCase { - private final String UNPACKABLE_FILE = "test.txt"; + private static final String UNPACKABLE_FILE = "test.txt"; - private final String UNPACKABLE_FILE_PATH = "target/test-classes/unit/unpack-dependencies-test/" + UNPACKABLE_FILE; + private static final String UNPACKABLE_FILE_PATH = + "target/test-classes/unit/unpack-dependencies-test/" + UNPACKABLE_FILE; private UnpackDependenciesMojo mojo; diff --git a/src/test/java/org/apache/maven/plugins/dependency/resolvers/GoOfflineMojoTest.java b/src/test/java/org/apache/maven/plugins/dependency/resolvers/GoOfflineMojoTest.java index caa00f160e..af3938585b 100644 --- a/src/test/java/org/apache/maven/plugins/dependency/resolvers/GoOfflineMojoTest.java +++ b/src/test/java/org/apache/maven/plugins/dependency/resolvers/GoOfflineMojoTest.java @@ -44,19 +44,19 @@ protected void setUp() throws Exception { getContainer().addComponent(session, MavenSession.class.getName()); } - String GROUP_EXCLUDE_PREFIX = "skip.this.groupid"; + private static final String GROUP_EXCLUDE_PREFIX = "skip.this.groupid"; - String ARTIFACT_EXCLUDE_PREFIX = "skip-this-artifact"; + private static final String ARTIFACT_EXCLUDE_PREFIX = "skip-this-artifact"; - String CLASSIFIER_EXCLUDE_PREFIX = "skipThisClassifier"; + private static final String CLASSIFIER_EXCLUDE_PREFIX = "skipThisClassifier"; - String DUMMY_ARTIFACT_NAME = "dummy-artifact"; + private static final String DUMMY_ARTIFACT_NAME = "dummy-artifact"; - String STUB_ARTIFACT_VERSION = "3.14"; + private static final String STUB_ARTIFACT_VERSION = "3.14"; - String VALID_GROUP = "org.junit.jupiter"; + private static final String VALID_GROUP = "org.junit.jupiter"; - public void test_excludeGroupIds() throws Exception { + public void testExcludeGroupIds() throws Exception { File testPom = new File(getBasedir(), "target/test-classes/unit/go-offline-test/exclude-plugin-config.xml"); subject = (GoOfflineMojo) lookupMojo("go-offline", testPom); @@ -91,7 +91,7 @@ public void test_excludeGroupIds() throws Exception { assertFalse(artifacts.contains(artifact2)); } - public void test_excludeArtifactIds() throws Exception { + public void testExcludeArtifactIds() throws Exception { File testPom = new File(getBasedir(), "target/test-classes/unit/go-offline-test/exclude-plugin-config.xml"); subject = (GoOfflineMojo) lookupMojo("go-offline", testPom); @@ -126,7 +126,7 @@ public void test_excludeArtifactIds() throws Exception { assertFalse(artifacts.contains(artifact2)); } - public void test_excludeScope() throws Exception { + public void testExcludeScope() throws Exception { File testPom = new File(getBasedir(), "target/test-classes/unit/go-offline-test/exclude-plugin-config.xml"); subject = (GoOfflineMojo) lookupMojo("go-offline", testPom); @@ -162,7 +162,7 @@ public void test_excludeScope() throws Exception { assertFalse(artifacts.contains(artifact2)); } - public void test_excludeTypes() throws Exception { + public void testExcludeTypes() throws Exception { File testPom = new File(getBasedir(), "target/test-classes/unit/go-offline-test/exclude-plugin-config.xml"); subject = (GoOfflineMojo) lookupMojo("go-offline", testPom); @@ -208,7 +208,7 @@ public void test_excludeTypes() throws Exception { * @throws Exception */ @Disabled("Requires update to maven-plugin-test-harness to support this test") - public void xtest_excludeClassifiers() throws Exception { + public void xtestExcludeClassifiers() throws Exception { File testPom = new File(getBasedir(), "target/test-classes/unit/go-offline-test/exclude-plugin-config.xml"); subject = (GoOfflineMojo) lookupMojo("go-offline", testPom); @@ -245,13 +245,13 @@ public void xtest_excludeClassifiers() throws Exception { assertTrue(artifacts.contains(artifact3)); } - String GROUP_INCLUDE_PREFIX = "include.this.groupid"; + private static final String GROUP_INCLUDE_PREFIX = "include.this.groupid"; - String ARTIFACT_INCLUDE_PREFIX = "include-this-artifact"; + private static final String ARTIFACT_INCLUDE_PREFIX = "include-this-artifact"; - String CLASSIFIER_INCLUDE_PREFIX = "includeThisClassifier"; + private static final String CLASSIFIER_INCLUDE_PREFIX = "includeThisClassifier"; - public void test_includeGroupIds() throws Exception { + public void testIncludeGroupIds() throws Exception { File testPom = new File(getBasedir(), "target/test-classes/unit/go-offline-test/include-gid-plugin-config.xml"); subject = (GoOfflineMojo) lookupMojo("go-offline", testPom); @@ -287,7 +287,7 @@ public void test_includeGroupIds() throws Exception { assertTrue(artifacts.contains(artifact2)); } - public void test_includeArtifactIds() throws Exception { + public void testIncludeArtifactIds() throws Exception { File testPom = new File(getBasedir(), "target/test-classes/unit/go-offline-test/include-aid-plugin-config.xml"); subject = (GoOfflineMojo) lookupMojo("go-offline", testPom); @@ -323,7 +323,7 @@ public void test_includeArtifactIds() throws Exception { assertTrue(artifacts.contains(artifact2)); } - public void test_includeScope() throws Exception { + public void testIncludeScope() throws Exception { File testPom = new File(getBasedir(), "target/test-classes/unit/go-offline-test/include-scope-plugin-config.xml"); @@ -363,7 +363,7 @@ public void test_includeScope() throws Exception { assertFalse(artifacts.contains(artifact3)); } - public void test_includeTypes() throws Exception { + public void testIncludeTypes() throws Exception { File testPom = new File(getBasedir(), "target/test-classes/unit/go-offline-test/include-types-plugin-config.xml");