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 f5754550b..73ae0f28f 100644 --- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java +++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java @@ -525,8 +525,8 @@ protected static JavadocVersion getJavadocVersion( File javadocExe ) cmd.setWorkingDirectory( javadocExe.getParentFile() ); cmd.createArg().setValue( "-J-version" ); - CommandLineUtils.StringStreamConsumer out = new CommandLineUtils.StringStreamConsumer(); - CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer(); + CommandLineUtils.StringStreamConsumer out = new JavadocOutputStreamConsumer(); + CommandLineUtils.StringStreamConsumer err = new JavadocOutputStreamConsumer(); int exitCode = CommandLineUtils.executeCommandLine( cmd, out, err ); @@ -1512,6 +1512,24 @@ public String nextToken() return token; } } + + /** + * Ignores line like 'Picked up JAVA_TOOL_OPTIONS: ...' as can happen on CI servers. + * + * @author Robert Scholte + * @since 3.0.1 + */ + private static class JavadocOutputStreamConsumer extends CommandLineUtils.StringStreamConsumer + { + @Override + public void consumeLine( String line ) + { + if ( !line.startsWith( "Picked up " ) ) + { + super.consumeLine( line ); + } + } + } static List toList( String src ) {