From c56ec0a989b34ee7383b7f5f16e4f8fca69149f8 Mon Sep 17 00:00:00 2001 From: Michael Osipov Date: Sun, 12 Feb 2023 18:46:21 +0100 Subject: [PATCH] [MJAVADOC-741] Upgrade plugins and components --- pom.xml | 32 +++++-------- .../maven/plugins/javadoc/JavadocUtil.java | 47 +++---------------- 2 files changed, 17 insertions(+), 62 deletions(-) diff --git a/pom.xml b/pom.xml index 1a469ea62..dc6a5a2b0 100644 --- a/pom.xml +++ b/pom.xml @@ -117,11 +117,11 @@ under the License. 2.4 1.0.0.v20140518 - 1.1.0 - 9.4.43.v20210629 + 1.1.2 + 9.4.50.v20221201 3.12.1 - 3.2.2 + 3.4.2 2022-08-10T19:51:10Z 1.7.36 @@ -219,12 +219,12 @@ under the License. org.apache.maven.shared maven-invoker - 3.1.0 + 3.2.0 org.apache.maven.shared maven-common-artifact-filters - 3.1.1 + 3.2.0 @@ -262,18 +262,18 @@ under the License. org.apache.httpcomponents httpclient - 4.5.13 + 4.5.14 org.apache.httpcomponents httpcore - 4.4.15 + 4.4.16 com.thoughtworks.qdox qdox - 2.0.1 + 2.0.3 @@ -285,7 +285,7 @@ under the License. org.codehaus.plexus plexus-utils - 3.4.2 + 3.5.0 commons-io @@ -371,7 +371,7 @@ under the License. org.assertj assertj-core - 3.23.1 + 3.24.2 test @@ -407,11 +407,6 @@ under the License. - - org.apache.maven.plugins - maven-jxr-plugin - 3.1.1 - org.apache.maven.plugins maven-javadoc-plugin @@ -420,11 +415,6 @@ under the License. false - - org.apache.maven.plugins - maven-project-info-reports-plugin - 3.1.2 - @@ -504,7 +494,7 @@ under the License. org.codehaus.mojo mrm-maven-plugin - 1.2.0 + 1.5.0 repository diff --git a/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java b/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java index bcad646e8..99369b6ba 100644 --- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java +++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java @@ -1006,27 +1006,17 @@ private static InvocationResult invoke( /** * @param log a logger could be null - * @return the Maven home defined in the maven.home system property or defined in M2_HOME - * system env variables or null if never set. + * @return the Maven home defined in the maven.home system property + * or null if never set. * @since 2.6 */ private static String getMavenHome(Log log) { String mavenHome = System.getProperty("maven.home"); - if (mavenHome == null) { - try { - mavenHome = CommandLineUtils.getSystemEnvVars().getProperty("M2_HOME"); - } catch (IOException e) { - if (log != null && log.isDebugEnabled()) { - log.debug("IOException: " + e.getMessage()); - } - } - } File m2Home = new File(mavenHome); if (!m2Home.exists()) { if (log != null && log.isErrorEnabled()) { - log.error("Cannot find Maven application directory. Either specify 'maven.home' system property, or " - + "M2_HOME environment variable."); + log.error("Cannot find Maven application directory. Either specify 'maven.home' system property."); } } @@ -1039,16 +1029,7 @@ private static String getMavenHome(Log log) { * @since 2.6 */ private static String getMavenOpts(Log log) { - String mavenOpts = null; - try { - mavenOpts = CommandLineUtils.getSystemEnvVars().getProperty("MAVEN_OPTS"); - } catch (IOException e) { - if (log != null && log.isDebugEnabled()) { - log.debug("IOException: " + e.getMessage()); - } - } - - return mavenOpts; + return CommandLineUtils.getSystemEnvVars().getProperty("MAVEN_OPTS"); } /** @@ -1061,14 +1042,7 @@ private static String getMavenOpts(Log log) { private static File getJavaHome(Log log) { File javaHome = null; - String javaHomeValue = null; - try { - javaHomeValue = CommandLineUtils.getSystemEnvVars().getProperty("JAVA_HOME"); - } catch (IOException e) { - if (log != null && log.isDebugEnabled()) { - log.debug("IOException: " + e.getMessage()); - } - } + String javaHomeValue = CommandLineUtils.getSystemEnvVars().getProperty("JAVA_HOME"); // if maven.home is set, we can assume JAVA_HOME must be used for testing if (System.getProperty("maven.home") == null || javaHomeValue == null) { @@ -1100,16 +1074,7 @@ private static File getJavaHome(Log log) { * @since 2.6 */ private static String getJavaOpts(Log log) { - String javaOpts = null; - try { - javaOpts = CommandLineUtils.getSystemEnvVars().getProperty("JAVA_OPTS"); - } catch (IOException e) { - if (log != null && log.isDebugEnabled()) { - log.debug("IOException: " + e.getMessage()); - } - } - - return javaOpts; + return CommandLineUtils.getSystemEnvVars().getProperty("JAVA_OPTS"); } /**