Details
-
Task
-
Status: Closed
-
Trivial
-
Resolution: Won't Fix
-
3.6.3
-
None
-
None
Description
cliMerge has a code to append all unrecognized arguments (i.e. goals)
from maven.config to the resulting CommandLine object:
private CommandLine cliMerge( CommandLine mavenArgs, CommandLine mavenConfig ) { CommandLine.Builder commandLineBuilder = new CommandLine.Builder(); // the args are easy, cli first then config file for ( String arg : mavenArgs.getArgs() ) { commandLineBuilder.addArg( arg ); } for ( String arg : mavenConfig.getArgs() ) { commandLineBuilder.addArg( arg ); } ...
But this code always does nothing since the result of maven.config parsing is checked
for absence of any such unrecognized arguments right before the merging
is performed:
void cli( CliRequest cliRequest ) throws Exception { ... mavenConfig = cliManager.parse( args.toArray( new String[0] ) ); List<?> unrecongized = mavenConfig.getArgList(); if ( !unrecongized.isEmpty() ) { throw new ParseException( "Unrecognized maven.config entries: " + unrecongized ); } ...
Note to the above snippets: CommandLine.getArgs() is almost the same as CommandLine.getArgList() - the only difference is that getArgs() returns String[] while getArgList() returns List<String>.
Attachments
Issue Links
- links to