You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jd...@apache.org on 2007/10/10 17:31:09 UTC
svn commit: r583515 -
/maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
Author: jdcasey
Date: Wed Oct 10 08:31:09 2007
New Revision: 583515
URL: http://svn.apache.org/viewvc?rev=583515&view=rev
Log:
some formatting
Modified:
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
Modified: maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java?rev=583515&r1=583514&r2=583515&view=diff
==============================================================================
--- maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java (original)
+++ maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java Wed Oct 10 08:31:09 2007
@@ -191,164 +191,164 @@
//
// ----------------------------------------------------------------------
- List goals = commandLine.getArgList();
+ List goals = commandLine.getArgList();
- boolean recursive = true;
+ boolean recursive = true;
- // this is the default behavior.
- String reactorFailureBehaviour = MavenExecutionRequest.REACTOR_FAIL_FAST;
+ // this is the default behavior.
+ String reactorFailureBehaviour = MavenExecutionRequest.REACTOR_FAIL_FAST;
- if ( commandLine.hasOption( CLIManager.NON_RECURSIVE ) )
- {
- recursive = false;
- }
-
- if ( commandLine.hasOption( CLIManager.FAIL_FAST ) )
- {
- reactorFailureBehaviour = MavenExecutionRequest.REACTOR_FAIL_FAST;
- }
- else if ( commandLine.hasOption( CLIManager.FAIL_AT_END ) )
- {
- reactorFailureBehaviour = MavenExecutionRequest.REACTOR_FAIL_AT_END;
- }
- else if ( commandLine.hasOption( CLIManager.FAIL_NEVER ) )
- {
- reactorFailureBehaviour = MavenExecutionRequest.REACTOR_FAIL_NEVER;
- }
+ if ( commandLine.hasOption( CLIManager.NON_RECURSIVE ) )
+ {
+ recursive = false;
+ }
- boolean offline = false;
-
- if ( commandLine.hasOption( CLIManager.OFFLINE ) )
- {
- offline = true;
- }
+ if ( commandLine.hasOption( CLIManager.FAIL_FAST ) )
+ {
+ reactorFailureBehaviour = MavenExecutionRequest.REACTOR_FAIL_FAST;
+ }
+ else if ( commandLine.hasOption( CLIManager.FAIL_AT_END ) )
+ {
+ reactorFailureBehaviour = MavenExecutionRequest.REACTOR_FAIL_AT_END;
+ }
+ else if ( commandLine.hasOption( CLIManager.FAIL_NEVER ) )
+ {
+ reactorFailureBehaviour = MavenExecutionRequest.REACTOR_FAIL_NEVER;
+ }
- boolean updateSnapshots = false;
-
- if ( commandLine.hasOption( CLIManager.UPDATE_SNAPSHOTS ) )
- {
- updateSnapshots = true;
- }
-
- String globalChecksumPolicy = null;
-
- if ( commandLine.hasOption( CLIManager.CHECKSUM_FAILURE_POLICY ) )
- {
- // todo; log
- System.out.println( "+ Enabling strict checksum verification on all artifact downloads." );
-
- globalChecksumPolicy = MavenExecutionRequest.CHECKSUM_POLICY_FAIL;
- }
- else if ( commandLine.hasOption( CLIManager.CHECKSUM_WARNING_POLICY ) )
- {
- // todo: log
- System.out.println( "+ Disabling strict checksum verification on all artifact downloads." );
-
- globalChecksumPolicy = MavenExecutionRequest.CHECKSUM_POLICY_WARN;
- }
+ boolean offline = false;
- File baseDirectory = new File( System.getProperty( "user.dir" ) );
+ if ( commandLine.hasOption( CLIManager.OFFLINE ) )
+ {
+ offline = true;
+ }
- // ----------------------------------------------------------------------
- // Profile Activation
- // ----------------------------------------------------------------------
+ boolean updateSnapshots = false;
- List activeProfiles = new ArrayList();
+ if ( commandLine.hasOption( CLIManager.UPDATE_SNAPSHOTS ) )
+ {
+ updateSnapshots = true;
+ }
- List inactiveProfiles = new ArrayList();
+ String globalChecksumPolicy = null;
- if ( commandLine.hasOption( CLIManager.ACTIVATE_PROFILES ) )
- {
- String profilesLine = commandLine.getOptionValue( CLIManager.ACTIVATE_PROFILES );
+ if ( commandLine.hasOption( CLIManager.CHECKSUM_FAILURE_POLICY ) )
+ {
+ // todo; log
+ System.out.println( "+ Enabling strict checksum verification on all artifact downloads." );
- StringTokenizer profileTokens = new StringTokenizer( profilesLine, "," );
+ globalChecksumPolicy = MavenExecutionRequest.CHECKSUM_POLICY_FAIL;
+ }
+ else if ( commandLine.hasOption( CLIManager.CHECKSUM_WARNING_POLICY ) )
+ {
+ // todo: log
+ System.out.println( "+ Disabling strict checksum verification on all artifact downloads." );
- while ( profileTokens.hasMoreTokens() )
- {
- String profileAction = profileTokens.nextToken().trim();
+ globalChecksumPolicy = MavenExecutionRequest.CHECKSUM_POLICY_WARN;
+ }
- if ( profileAction.startsWith( "-" ) )
- {
- activeProfiles.add( profileAction.substring( 1 ) );
- }
- else if ( profileAction.startsWith( "+" ) )
- {
- inactiveProfiles.add( profileAction.substring( 1 ) );
- }
- else
- {
- // TODO: deprecate this eventually!
- activeProfiles.add( profileAction );
- }
- }
- }
+ File baseDirectory = new File( System.getProperty( "user.dir" ) );
- MavenTransferListener transferListener;
+ // ----------------------------------------------------------------------
+ // Profile Activation
+ // ----------------------------------------------------------------------
- if ( interactive )
- {
- transferListener = new ConsoleDownloadMonitor();
- }
- else
- {
- transferListener = new BatchModeDownloadMonitor();
- }
+ List activeProfiles = new ArrayList();
- transferListener.setShowChecksumEvents( false );
+ List inactiveProfiles = new ArrayList();
- // This means to scan a directory structure for POMs and process them.
- boolean useReactor = false;
+ if ( commandLine.hasOption( CLIManager.ACTIVATE_PROFILES ) )
+ {
+ String profilesLine = commandLine.getOptionValue( CLIManager.ACTIVATE_PROFILES );
- if ( commandLine.hasOption( CLIManager.REACTOR ) )
- {
- useReactor = true;
- }
+ StringTokenizer profileTokens = new StringTokenizer( profilesLine, "," );
- String alternatePomFile = null;
- if ( commandLine.hasOption( CLIManager.ALTERNATE_POM_FILE ) )
+ while ( profileTokens.hasMoreTokens() )
{
- alternatePomFile = commandLine.getOptionValue( CLIManager.ALTERNATE_POM_FILE );
- }
-
- int loggingLevel;
+ String profileAction = profileTokens.nextToken().trim();
- if ( debug )
- {
- loggingLevel = MavenExecutionRequest.LOGGING_LEVEL_DEBUG;
- }
- else if ( quiet )
- {
- // TODO: we need to do some more work here. Some plugins use sys out or log errors at info level.
- // Ideally, we could use Warn across the board
- loggingLevel = MavenExecutionRequest.LOGGING_LEVEL_ERROR;
- // TODO:Additionally, we can't change the mojo level because the component key includes the version and it isn't known ahead of time. This seems worth changing.
- }
- else
- {
- loggingLevel = MavenExecutionRequest.LOGGING_LEVEL_INFO;
+ if ( profileAction.startsWith( "-" ) )
+ {
+ activeProfiles.add( profileAction.substring( 1 ) );
+ }
+ else if ( profileAction.startsWith( "+" ) )
+ {
+ inactiveProfiles.add( profileAction.substring( 1 ) );
+ }
+ else
+ {
+ // TODO: deprecate this eventually!
+ activeProfiles.add( profileAction );
+ }
}
+ }
- Properties executionProperties = getExecutionProperties( commandLine );
+ MavenTransferListener transferListener;
- MavenExecutionRequest request = new DefaultMavenExecutionRequest()
- .setBaseDirectory( baseDirectory )
- .setGoals( goals )
- .setProperties( executionProperties ) // optional
- .setReactorFailureBehavior( reactorFailureBehaviour ) // default: fail fast
- .setRecursive( recursive ) // default: true
- .setUseReactor( useReactor ) // default: false
- .setPomFile( alternatePomFile ) // optional
- .setShowErrors( showErrors ) // default: false
- .setInteractiveMode( interactive ) // default: false
- .setOffline( offline ) // default: false
- .setUsePluginUpdateOverride( pluginUpdateOverride )
- .addActiveProfiles( activeProfiles ) // optional
- .addInactiveProfiles( inactiveProfiles ) // optional
- .setLoggingLevel( loggingLevel ) // default: info
- .setTransferListener( transferListener ) // default: batch mode which goes along with interactive
- .setUpdateSnapshots( updateSnapshots ) // default: false
- .setNoSnapshotUpdates( noSnapshotUpdates ) // default: false
- .setGlobalChecksumPolicy( globalChecksumPolicy ); // default: warn
+ if ( interactive )
+ {
+ transferListener = new ConsoleDownloadMonitor();
+ }
+ else
+ {
+ transferListener = new BatchModeDownloadMonitor();
+ }
+
+ transferListener.setShowChecksumEvents( false );
+
+ // This means to scan a directory structure for POMs and process them.
+ boolean useReactor = false;
+
+ if ( commandLine.hasOption( CLIManager.REACTOR ) )
+ {
+ useReactor = true;
+ }
+
+ String alternatePomFile = null;
+ if ( commandLine.hasOption( CLIManager.ALTERNATE_POM_FILE ) )
+ {
+ alternatePomFile = commandLine.getOptionValue( CLIManager.ALTERNATE_POM_FILE );
+ }
+
+ int loggingLevel;
+
+ if ( debug )
+ {
+ loggingLevel = MavenExecutionRequest.LOGGING_LEVEL_DEBUG;
+ }
+ else if ( quiet )
+ {
+ // TODO: we need to do some more work here. Some plugins use sys out or log errors at info level.
+ // Ideally, we could use Warn across the board
+ loggingLevel = MavenExecutionRequest.LOGGING_LEVEL_ERROR;
+ // TODO:Additionally, we can't change the mojo level because the component key includes the version and it isn't known ahead of time. This seems worth changing.
+ }
+ else
+ {
+ loggingLevel = MavenExecutionRequest.LOGGING_LEVEL_INFO;
+ }
+
+ Properties executionProperties = getExecutionProperties( commandLine );
+
+ MavenExecutionRequest request = new DefaultMavenExecutionRequest()
+ .setBaseDirectory( baseDirectory )
+ .setGoals( goals )
+ .setProperties( executionProperties ) // optional
+ .setReactorFailureBehavior( reactorFailureBehaviour ) // default: fail fast
+ .setRecursive( recursive ) // default: true
+ .setUseReactor( useReactor ) // default: false
+ .setPomFile( alternatePomFile ) // optional
+ .setShowErrors( showErrors ) // default: false
+ .setInteractiveMode( interactive ) // default: false
+ .setOffline( offline ) // default: false
+ .setUsePluginUpdateOverride( pluginUpdateOverride )
+ .addActiveProfiles( activeProfiles ) // optional
+ .addInactiveProfiles( inactiveProfiles ) // optional
+ .setLoggingLevel( loggingLevel ) // default: info
+ .setTransferListener( transferListener ) // default: batch mode which goes along with interactive
+ .setUpdateSnapshots( updateSnapshots ) // default: false
+ .setNoSnapshotUpdates( noSnapshotUpdates ) // default: false
+ .setGlobalChecksumPolicy( globalChecksumPolicy ); // default: warn
File userSettingsFile;