[MNG-4697] Deprecate ununsed CLI options for plugin registry

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@951135 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2010-06-03 19:53:09 +00:00
parent 0de8e71bc6
commit c94f27a8b4
4 changed files with 14 additions and 39 deletions

View File

@ -62,8 +62,6 @@ public class DefaultMavenExecutionRequest
private List<String> pluginGroups;
private boolean usePluginUpdateOverride;
private boolean isProjectPresent = true;
// ----------------------------------------------------------------------------
@ -153,7 +151,6 @@ public class DefaultMavenExecutionRequest
copy.setMirrors( original.getMirrors() );
copy.setProfiles( original.getProfiles() );
copy.setPluginGroups( original.getPluginGroups() );
copy.setUsePluginUpdateOverride( original.isUsePluginUpdateOverride() );
copy.setProjectPresent( original.isProjectPresent() );
copy.setUserSettingsFile( original.getUserSettingsFile() );
copy.setGlobalSettingsFile( original.getGlobalSettingsFile() );
@ -836,18 +833,6 @@ public class DefaultMavenExecutionRequest
return this;
}
public boolean isUsePluginUpdateOverride()
{
return usePluginUpdateOverride;
}
public MavenExecutionRequest setUsePluginUpdateOverride( boolean usePluginUpdateOverride )
{
this.usePluginUpdateOverride = usePluginUpdateOverride;
return this;
}
public MavenExecutionRequest setRecursive( boolean recursive )
{
this.recursive = recursive;

View File

@ -237,9 +237,6 @@ public interface MavenExecutionRequest
MavenExecutionRequest addPluginGroup( String pluginGroup );
MavenExecutionRequest addPluginGroups( List<String> pluginGroups );
boolean isUsePluginUpdateOverride();
MavenExecutionRequest setUsePluginUpdateOverride( boolean usePluginUpdateOverride );
boolean isProjectPresent();
MavenExecutionRequest setProjectPresent( boolean isProjectPresent );

View File

@ -60,12 +60,6 @@ public class CLIManager
public static final char ACTIVATE_PROFILES = 'P';
public static final String FORCE_PLUGIN_UPDATES = "cpu";
public static final String FORCE_PLUGIN_UPDATES2 = "up";
public static final String SUPPRESS_PLUGIN_UPDATES = "npu";
public static final String SUPRESS_SNAPSHOT_UPDATES = "nsu";
public static final char CHECKSUM_FAILURE_POLICY = 'C';
@ -118,9 +112,6 @@ public class CLIManager
options.addOption( OptionBuilder.withLongOpt( "update-snapshots" ).withDescription( "Forces a check for updated releases and snapshots on remote repositories" ).create( UPDATE_SNAPSHOTS ) );
options.addOption( OptionBuilder.withLongOpt( "activate-profiles" ).withDescription( "Comma-delimited list of profiles to activate" ).hasArg().create( ACTIVATE_PROFILES ) );
options.addOption( OptionBuilder.withLongOpt( "batch-mode" ).withDescription( "Run in non-interactive (batch) mode" ).create( BATCH_MODE ) );
options.addOption( OptionBuilder.withLongOpt( "check-plugin-updates" ).withDescription( "Force upToDate check for any relevant registered plugins" ).create( FORCE_PLUGIN_UPDATES ) );
options.addOption( OptionBuilder.withLongOpt( "update-plugins" ).withDescription( "Synonym for " + FORCE_PLUGIN_UPDATES ).create( FORCE_PLUGIN_UPDATES2 ) );
options.addOption( OptionBuilder.withLongOpt( "no-plugin-updates" ).withDescription( "Suppress upToDate check for any relevant registered plugins" ).create( SUPPRESS_PLUGIN_UPDATES ) );
options.addOption( OptionBuilder.withLongOpt( "no-snapshot-updates" ).withDescription( "Supress SNAPSHOT updates" ).create( SUPRESS_SNAPSHOT_UPDATES ) );
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 ) );
@ -143,6 +134,9 @@ public class CLIManager
// Adding this back in for compatibility with the verifier that hard codes this option.
options.addOption( OptionBuilder.withLongOpt( "no-plugin-registry" ).withDescription( "Ineffective, only kept for backward compatibility" ).create( "npr" ) );
options.addOption( OptionBuilder.withLongOpt( "check-plugin-updates" ).withDescription( "Ineffective, only kept for backward compatibility" ).create( "cpu" ) );
options.addOption( OptionBuilder.withLongOpt( "update-plugins" ).withDescription( "Ineffective, only kept for backward compatibility" ).create( "up" ) );
options.addOption( OptionBuilder.withLongOpt( "no-plugin-updates" ).withDescription( "Ineffective, only kept for backward compatibility" ).create( "npu" ) );
}
public CommandLine parse( String[] args )

View File

@ -630,6 +630,16 @@ public class MavenCli
boolean debug = cliRequest.debug;
boolean quiet = cliRequest.quiet;
boolean showErrors = cliRequest.showErrors;
String[] deprecatedOptions = { "up", "npu", "cpu", "npr" };
for ( String deprecatedOption : deprecatedOptions )
{
if ( commandLine.hasOption( deprecatedOption ) )
{
cliRequest.stdout.println( "[WARNING] Command line option -" + deprecatedOption
+ " is deprecated and will be removed in future Maven versions." );
}
}
// ----------------------------------------------------------------------
// Now that we have everything that we need we will fire up plexus and
@ -641,17 +651,6 @@ public class MavenCli
request.setInteractiveMode( false );
}
boolean pluginUpdateOverride = false;
if ( commandLine.hasOption( CLIManager.FORCE_PLUGIN_UPDATES ) || commandLine.hasOption( CLIManager.FORCE_PLUGIN_UPDATES2 ) )
{
pluginUpdateOverride = true;
}
else if ( commandLine.hasOption( CLIManager.SUPPRESS_PLUGIN_UPDATES ) )
{
pluginUpdateOverride = false;
}
boolean noSnapshotUpdates = false;
if ( commandLine.hasOption( CLIManager.SUPRESS_SNAPSHOT_UPDATES ) )
{
@ -809,7 +808,7 @@ public class MavenCli
.setReactorFailureBehavior( reactorFailureBehaviour ) // default: fail fast
.setRecursive( recursive ) // default: true
.setShowErrors( showErrors ) // default: false
.setUsePluginUpdateOverride( pluginUpdateOverride ).addActiveProfiles( activeProfiles ) // optional
.addActiveProfiles( activeProfiles ) // optional
.addInactiveProfiles( inactiveProfiles ) // optional
.setLoggingLevel( loggingLevel ) // default: info
.setTransferListener( transferListener ) // default: batch mode which goes along with interactive