[MNG-4896] Help for -pl option does not include use of comma-sep, also more than one -pl does not work or complain

Submitted by: Jason Dillon

o Applied with fixed formatting

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1034892 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2010-11-13 22:09:24 +00:00
parent 0fb027ea44
commit 99b2cd2576
2 changed files with 9 additions and 4 deletions

View File

@ -126,7 +126,7 @@ public class CLIManager
options.addOption( OptionBuilder.withLongOpt( "fail-at-end" ).withDescription( "Only fail the build afterwards; allow all non-impacted builds to continue" ).create( FAIL_AT_END ) ); options.addOption( OptionBuilder.withLongOpt( "fail-at-end" ).withDescription( "Only fail the build afterwards; allow all non-impacted builds to continue" ).create( FAIL_AT_END ) );
options.addOption( OptionBuilder.withLongOpt( "fail-never" ).withDescription( "NEVER fail the build, regardless of project result" ).create( FAIL_NEVER ) ); options.addOption( OptionBuilder.withLongOpt( "fail-never" ).withDescription( "NEVER fail the build, regardless of project result" ).create( FAIL_NEVER ) );
options.addOption( OptionBuilder.withLongOpt( "resume-from" ).hasArg().withDescription( "Resume reactor from specified project" ).create( RESUME_FROM ) ); options.addOption( OptionBuilder.withLongOpt( "resume-from" ).hasArg().withDescription( "Resume reactor from specified project" ).create( RESUME_FROM ) );
options.addOption( OptionBuilder.withLongOpt( "projects" ).withDescription( "Build specified reactor projects instead of all projects. A project can be specified by [groupId]:artifactId or by its relative path." ).hasArg().create( PROJECT_LIST ) ); options.addOption( OptionBuilder.withLongOpt( "projects" ).withDescription( "Comma-delimited list of specified reactor projects to build instead of all projects. A project can be specified by [groupId]:artifactId or by its relative path." ).hasArg().create( PROJECT_LIST ) );
options.addOption( OptionBuilder.withLongOpt( "also-make" ).withDescription( "If project list is specified, also build projects required by the list" ).create( ALSO_MAKE ) ); options.addOption( OptionBuilder.withLongOpt( "also-make" ).withDescription( "If project list is specified, also build projects required by the list" ).create( ALSO_MAKE ) );
options.addOption( OptionBuilder.withLongOpt( "also-make-dependents" ).withDescription( "If project list is specified, also build projects that depend on projects on the list" ).create( ALSO_MAKE_DEPENDENTS ) ); options.addOption( OptionBuilder.withLongOpt( "also-make-dependents" ).withDescription( "If project list is specified, also build projects that depend on projects on the list" ).create( ALSO_MAKE_DEPENDENTS ) );
options.addOption( OptionBuilder.withLongOpt( "log-file" ).hasArg().withDescription( "Log file to where all build output will go." ).create( LOG_FILE ) ); options.addOption( OptionBuilder.withLongOpt( "log-file" ).hasArg().withDescription( "Log file to where all build output will go." ).create( LOG_FILE ) );

View File

@ -861,9 +861,14 @@ public class MavenCli
if ( commandLine.hasOption( CLIManager.PROJECT_LIST ) ) if ( commandLine.hasOption( CLIManager.PROJECT_LIST ) )
{ {
String projectList = commandLine.getOptionValue( CLIManager.PROJECT_LIST ); String[] values = commandLine.getOptionValues( CLIManager.PROJECT_LIST );
String[] projects = StringUtils.split( projectList, "," ); List<String> projects = new ArrayList<String>();
request.setSelectedProjects( Arrays.asList( projects ) ); for ( int i = 0; i < values.length; i++ )
{
String[] tmp = StringUtils.split( values[i], "," );
projects.addAll( Arrays.asList( tmp ) );
}
request.setSelectedProjects( projects );
} }
if ( commandLine.hasOption( CLIManager.ALSO_MAKE ) if ( commandLine.hasOption( CLIManager.ALSO_MAKE )