From b51c5d801c1e329b1e59e7b66142c8fd9c0ba6af Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Sat, 23 Oct 2021 16:21:29 +0200 Subject: [PATCH] [MJAVADOC-694] Avoid empty warn message from getResolvePathResult --- .../maven/plugins/javadoc/AbstractJavadocMojo.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java index b1b5a57ae..6fde43e8e 100644 --- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java +++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java @@ -5543,12 +5543,16 @@ private ResolvePathResult getResolvePathResult( File artifactFile ) } catch ( IOException | RuntimeException /* e.g java.lang.module.FindException */ e ) { - Throwable cause = e; - while ( cause.getCause() != null ) + if ( getLog().isDebugEnabled() ) { - cause = cause.getCause(); + Throwable cause = e; + while ( cause.getCause() != null ) + { + cause = cause.getCause(); + } + + getLog().debug( "resolve path for: " + artifactFile + " cause error: " + cause ); } - getLog().warn( e.getMessage() ); } return resolvePathResult; }