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 Thu, 07 Apr 2005 02:28:25 GMT
brett       2005/04/06 19:28:25

  Modified:    maven-artifact/src/main/java/org/apache/maven/artifact/metadata
                        SnapshotArtifactMetadata.java
               maven-artifact/src/main/java/org/apache/maven/artifact/transform
                        SnapshotTransformation.java
  Log:
  PR: MNG-255
  recognise versions in the timestamp format and set the correct base version for resolution
  
  Revision  Changes    Path
  1.17      +2 -2      maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/SnapshotArtifactMetadata.java
  
  Index: SnapshotArtifactMetadata.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/SnapshotArtifactMetadata.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- SnapshotArtifactMetadata.java	5 Apr 2005 14:17:55 -0000	1.16
  +++ SnapshotArtifactMetadata.java	7 Apr 2005 02:28:24 -0000	1.17
  @@ -56,7 +56,7 @@
   
       private long lastModified = 0;
   
  -    private static final Pattern VERSION_FILE_PATTERN = Pattern.compile( "^(.*)-([0-9]{8}.[0-9]{6})-([0-9]+)$"
);
  +    public static final Pattern VERSION_FILE_PATTERN = Pattern.compile( "^(.*)-([0-9]{8}.[0-9]{6})-([0-9]+)$"
);
   
       // TODO: very quick and nasty hack to get the same timestamp across a build - not embedder
friendly
       private static String sessionTimestamp = null;
  
  
  
  1.19      +7 -1      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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- SnapshotTransformation.java	5 Apr 2005 01:58:33 -0000	1.18
  +++ SnapshotTransformation.java	7 Apr 2005 02:28:25 -0000	1.19
  @@ -32,6 +32,7 @@
   import java.util.Iterator;
   import java.util.List;
   import java.util.Set;
  +import java.util.regex.Matcher;
   
   /**
    * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  @@ -53,7 +54,12 @@
       public void transformForResolve( Artifact artifact, List remoteRepositories, ArtifactRepository
localRepository )
           throws ArtifactMetadataRetrievalException
       {
  -        if ( isSnapshot( artifact ) )
  +        Matcher m = SnapshotArtifactMetadata.VERSION_FILE_PATTERN.matcher( artifact.getBaseVersion()
);
  +        if ( m.matches() )
  +        {
  +            artifact.setBaseVersion( m.group( 1 ) + "-SNAPSHOT" );
  +        }
  +        else if ( isSnapshot( artifact ) )
           {
               SnapshotArtifactMetadata localMetadata;
               try
  
  
  

Mime
View raw message