mirror of https://github.com/apache/maven.git
[MNG-3914] Add CLI option to control location of global settings from command line
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@726563 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
48d853ad6e
commit
7e76510cdc
|
@ -74,6 +74,8 @@ public class CLIManager
|
|||
|
||||
public static final char ALTERNATE_USER_SETTINGS = 's';
|
||||
|
||||
public static final String ALTERNATE_GLOBAL_SETTINGS = "gs";
|
||||
|
||||
public static final String FAIL_FAST = "ff";
|
||||
|
||||
public static final String FAIL_AT_END = "fae";
|
||||
|
@ -108,6 +110,7 @@ public class CLIManager
|
|||
options.addOption( OptionBuilder.withLongOpt( "strict-checksums" ).withDescription( "Fail the build if checksums don't match" ).create( CHECKSUM_FAILURE_POLICY ) );
|
||||
options.addOption( OptionBuilder.withLongOpt( "lax-checksums" ).withDescription( "Warn if checksums don't match" ).create( CHECKSUM_WARNING_POLICY ) );
|
||||
options.addOption( OptionBuilder.withLongOpt( "settings" ).withDescription( "Alternate path for the user settings file" ).hasArg().create( ALTERNATE_USER_SETTINGS ) );
|
||||
options.addOption( OptionBuilder.withLongOpt( "global-settings" ).withDescription( "Alternate path for the global settings file" ).hasArg().create( ALTERNATE_GLOBAL_SETTINGS ) );
|
||||
options.addOption( OptionBuilder.withLongOpt( "fail-fast" ).withDescription( "Stop at first failure in reactorized builds" ).create( FAIL_FAST ) );
|
||||
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 ) );
|
||||
|
|
|
@ -190,13 +190,24 @@ public class MavenCli
|
|||
}
|
||||
else
|
||||
{
|
||||
userSettingsFile = MavenEmbedder.DEFAULT_USER_SETTINGS_FILE;
|
||||
userSettingsFile = MavenEmbedder.DEFAULT_USER_SETTINGS_FILE;
|
||||
}
|
||||
|
||||
File globalSettingsFile;
|
||||
|
||||
if ( commandLine.hasOption( CLIManager.ALTERNATE_GLOBAL_SETTINGS ) )
|
||||
{
|
||||
globalSettingsFile = new File( commandLine.getOptionValue( CLIManager.ALTERNATE_GLOBAL_SETTINGS ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
globalSettingsFile = MavenEmbedder.DEFAULT_GLOBAL_SETTINGS_FILE;
|
||||
}
|
||||
|
||||
Configuration configuration = new DefaultConfiguration()
|
||||
.setErrorReporter( new DefaultCoreErrorReporter() )
|
||||
.setUserSettingsFile( userSettingsFile )
|
||||
.setGlobalSettingsFile( MavenEmbedder.DEFAULT_GLOBAL_SETTINGS_FILE )
|
||||
.setGlobalSettingsFile( globalSettingsFile )
|
||||
.setClassWorld( classWorld );
|
||||
|
||||
if ( commandLine.hasOption( CLIManager.LOG_FILE ) )
|
||||
|
|
Loading…
Reference in New Issue