Skip to content

Commit

Permalink
Introduce consumer to ignore lines starting with 'Picked up '
Browse files Browse the repository at this point in the history
  • Loading branch information
rfscholte committed Jan 6, 2018
1 parent 9809cf1 commit 12dbbde
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down Expand Up @@ -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<String> toList( String src )
{
Expand Down

0 comments on commit 12dbbde

Please # to comment.