diff --git a/pom.xml b/pom.xml index 364c55ac..8b45cb44 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ under the License. - 3.2.5 + 3.6.3 2.15.0 2.4.21 @@ -127,6 +127,10 @@ under the License. org.apache.maven.shared maven-shared-utils + + org.codehaus.plexus + plexus-component-annotations + @@ -160,14 +164,7 @@ under the License. org.apache.maven.plugin-testing maven-plugin-testing-harness - 3.3.0 - test - - - - org.apache.maven - maven-compat - ${mavenVersion} + 4.0.0-alpha-2 test @@ -218,6 +215,29 @@ under the License. + + org.apache.maven.plugins + maven-plugin-report-plugin + + + + from 3.13.0 + 3.6.3 + 8 + + + from 3.9.0 to 3.12.1 + 3.2.5 + 8 + + + from 3.0 to 3.8.1 + 3.0 + 7 + + + + diff --git a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java index 78803f7d..f9e74706 100644 --- a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java +++ b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java @@ -21,8 +21,6 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; @@ -1503,9 +1501,7 @@ protected final Toolchain getToolchain() { Toolchain tc = null; if (jdkToolchain != null) { - // require Maven 3.3.1, that has plugin execution scoped Toolchain support: MNG-5755 - List tcs = getToolchains(); - + List tcs = toolchainManager.getToolchains(session, "jdk", jdkToolchain); if (tcs != null && !tcs.isEmpty()) { tc = tcs.get(0); } @@ -1518,26 +1514,6 @@ protected final Toolchain getToolchain() { return tc; } - // TODO use direct method invocation when prerequisite upgraded to Maven 3.3.1 - private List getToolchains() { - try { - Method getToolchainsMethod = - toolchainManager.getClass().getMethod("getToolchains", MavenSession.class, String.class, Map.class); - - @SuppressWarnings("unchecked") - List tcs = - (List) getToolchainsMethod.invoke(toolchainManager, session, "jdk", jdkToolchain); - return tcs; - } catch (NoSuchMethodException - | SecurityException - | IllegalAccessException - | IllegalArgumentException - | InvocationTargetException e) { - // ignore - } - return null; - } - private boolean isDigits(String string) { for (int i = 0; i < string.length(); i++) { if (!Character.isDigit(string.charAt(i))) {