maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/transform SnapshotTransformation.java
Date Wed, 30 Mar 2005 04:52:01 GMT
brett       2005/03/29 20:52:01

  Modified:    maven-core/src/main/java/org/apache/maven/cli MavenCli.java
               maven-artifact/src/main/java/org/apache/maven/artifact/transform
                        SnapshotTransformation.java
  Log:
  make the offline switch set a global snapshot policy of "never" for now
  
  Revision  Changes    Path
  1.25      +10 -7     maven-components/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java
  
  Index: MavenCli.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- MavenCli.java	30 Mar 2005 03:30:08 -0000	1.24
  +++ MavenCli.java	30 Mar 2005 04:52:01 -0000	1.25
  @@ -139,7 +139,12 @@
           ArtifactRepositoryFactory artifactRepositoryFactory = (ArtifactRepositoryFactory)
embedder.lookup(
               ArtifactRepositoryFactory.ROLE );
   
  -        if ( commandLine.hasOption( CLIManager.UPDATE_SNAPSHOTS ) )
  +        if ( commandLine.hasOption( CLIManager.OFFLINE ) )
  +        {
  +            // TODO: this will still check to download if the artifact does not exist locally,
instead of failing as it should in offline mode
  +            artifactRepositoryFactory.setGlobalSnapshotPolicy( ArtifactRepository.SNAPSHOT_POLICY_NEVER
);
  +        }
  +        else if ( commandLine.hasOption( CLIManager.UPDATE_SNAPSHOTS ) )
           {
               artifactRepositoryFactory.setGlobalSnapshotPolicy( ArtifactRepository.SNAPSHOT_POLICY_ALWAYS
);
           }
  @@ -285,7 +290,7 @@
   
           public static final char SET_SYSTEM_PROPERTY = 'D';
   
  -        public static final char WORK_OFFLINE = 'o';
  +        public static final char OFFLINE = 'o';
   
           public static final char REACTOR = 'r';
   
  @@ -315,14 +320,12 @@
                   NO_BANNER ) );
               options.addOption( OptionBuilder.withLongOpt( "define" ).hasArg().withDescription(
                   "Define a system property" ).create( SET_SYSTEM_PROPERTY ) );
  -            options.addOption( OptionBuilder.withLongOpt( "offline" ).hasArg().withDescription(
"Work offline" ).create(
  -                WORK_OFFLINE ) );
  +            options.addOption( OptionBuilder.withLongOpt( "offline" ).withDescription(
"Work offline" ).create(
  +                OFFLINE ) );
               options.addOption( OptionBuilder.withLongOpt( "mojoDescriptors" ).withDescription(
                   "Display available mojoDescriptors" ).create( LIST_GOALS ) );
               options.addOption( OptionBuilder.withLongOpt( "help" ).withDescription( "Display
help information" ).create(
                   HELP ) );
  -            options.addOption( OptionBuilder.withLongOpt( "offline" ).withDescription(
"Build is happening offline" ).create(
  -                WORK_OFFLINE ) );
               options.addOption( OptionBuilder.withLongOpt( "version" ).withDescription(
"Display version information" ).create(
                   VERSION ) );
               options.addOption( OptionBuilder.withLongOpt( "debug" ).withDescription( "Produce
execution debug output" ).create(
  
  
  
  1.14      +1 -3      maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/transform/SnapshotTransformation.java
  
  Index: SnapshotTransformation.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/transform/SnapshotTransformation.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- SnapshotTransformation.java	30 Mar 2005 03:30:08 -0000	1.13
  +++ SnapshotTransformation.java	30 Mar 2005 04:52:01 -0000	1.14
  @@ -72,9 +72,7 @@
               }
   
               String version = localMetadata.constructVersion();
  -            // TODO: remove hack
  -            if ( !alreadyResolved( artifact ) &&
  -                !Boolean.valueOf( System.getProperty( "maven.debug.snapshot.disabled",
"false" ) ).booleanValue() )
  +            if ( !alreadyResolved( artifact ) )
               {
                   boolean checkedUpdates = false;
                   for ( Iterator i = remoteRepositories.iterator(); i.hasNext(); )
  
  
  

Mime
View raw message