[ http://jira.codehaus.org/browse/MCOMPILER-130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=233727#action_233727 ]
Per Hedman commented on MCOMPILER-130: -------------------------------------- It's seems like the compiler gets the whole string "-Xmaxerrs 1000" as an argument, and not the working version with the argument and value pair of "-Xmaxerrs" "1000". In the AbstractCompilerMojo there is a line about creating the creation of the commandLine: String[] cl = compiler.createCommandLine( compilerConfiguration ); And then loops through the String Array, but when setting the "<compilerArgument>-Xmaxerrs 1000</compilerArgument>" the inner content is considered a single argument, and separation between arguments and values are a single space " ". I think that it's escaping the spaces within the compilerArgument. I have tried "<compilerArgument>-verbose -help</compilerArgument>" and that gives the same result. This is tested on Mac OS X. > compilerArgument option doesn't work with maxerrs option, compilerArguments > does > -------------------------------------------------------------------------------- > > Key: MCOMPILER-130 > URL: http://jira.codehaus.org/browse/MCOMPILER-130 > Project: Maven 2.x Compiler Plugin > Issue Type: Bug > Environment: Mac OS X > Reporter: Mike Dikan > > I looked into using this configuration for maven: > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-compiler-plugin</artifactId> > <configuration> > <compilerArgument>-Xmaxerrs 1000</compilerArgument> > </configuration> > </plugin> > But no dice: > Failure executing javac, but could not parse the error: > javac: invalid flag: -Xmaxerrs 1000 > Usage: javac <options> <source files> > use -help for a list of possible options > On the command line using javac, the maxerrs flag works as expected, and > using the compilerArguments "Map" option works: > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-compiler-plugin</artifactId> > <configuration> > <fork>true</fork> > <compilerArguments> > <Xmaxerrs>10</Xmaxerrs> > </compilerArguments> > </configuration> > </plugin> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira