Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[maven-release-plugin] copy for tag nexus-indexer-2.0.4

git-svn-id: file:///opt/svn/repositories/sonatype.org/nexus/tags/nexus-indexer-2.0.4@5920 2aa8b3fc-8ebb-4439-a84f-95066eaea8ab
  • Loading branch information...
commit c04e70abb591653a18f4c08f3a45274a10d3572f 2 parents 4c13170 + 30b1a12
dbradicich authored
View
2  src/main/java/org/sonatype/nexus/artifact/M2GavCalculator.java
@@ -83,7 +83,7 @@ else if ( s.endsWith( ".sha1" ) )
return null;
}
- boolean snapshot = version.endsWith( "-SNAPSHOT" ) || !getEnforcer().isStrict() && version.endsWith( "SNAPSHOT" );
+ boolean snapshot = version.endsWith( "SNAPSHOT" );
if ( snapshot )
{
View
52 src/test/java/org/sonatype/nexus/artifact/M2GavCalculatorTest.java
@@ -332,6 +332,43 @@ public void testGav()
path = gavCalculator.gavToPath( gav );
assertEquals( "/foo1/foo1/0.0.1-SNAPSHOT/foo1-0.0.1-SNAPSHOT.pom", path );
+ // NEXUS-3148
+ gav = gavCalculator.pathToGav( "/foo1/foo1/0.0.1SNAPSHOT/foo1-0.0.1SNAPSHOT.pom" );
+ assertEquals( "foo1", gav.getGroupId() );
+ assertEquals( "foo1", gav.getArtifactId() );
+ assertEquals( "0.0.1SNAPSHOT", gav.getVersion() );
+ assertEquals( "0.0.1SNAPSHOT", gav.getBaseVersion() );
+ assertEquals( null, gav.getClassifier() );
+ assertEquals( "pom", gav.getExtension() );
+ assertEquals( null, gav.getSnapshotBuildNumber() );
+ assertEquals( null, gav.getSnapshotTimeStamp() );
+ assertEquals( "foo1-0.0.1SNAPSHOT.pom", gav.getName() );
+ assertEquals( true, gav.isSnapshot() );
+ assertEquals( false, gav.isHash() );
+ assertEquals( null, gav.getHashType() );
+
+ path = gavCalculator.gavToPath( gav );
+ assertEquals( "/foo1/foo1/0.0.1SNAPSHOT/foo1-0.0.1SNAPSHOT.pom", path );
+
+ gav = gavCalculator.pathToGav( "/foo1/foo1/0.0.1.SNAPSHOT/foo1-0.0.1.SNAPSHOT.pom" );
+ assertEquals( "foo1", gav.getGroupId() );
+ assertEquals( "foo1", gav.getArtifactId() );
+ assertEquals( "0.0.1.SNAPSHOT", gav.getVersion() );
+ assertEquals( "0.0.1.SNAPSHOT", gav.getBaseVersion() );
+ assertEquals( null, gav.getClassifier() );
+ assertEquals( "pom", gav.getExtension() );
+ assertEquals( null, gav.getSnapshotBuildNumber() );
+ assertEquals( null, gav.getSnapshotTimeStamp() );
+ assertEquals( "foo1-0.0.1.SNAPSHOT.pom", gav.getName() );
+ assertEquals( true, gav.isSnapshot() );
+ assertEquals( false, gav.isHash() );
+ assertEquals( null, gav.getHashType() );
+
+ path = gavCalculator.gavToPath( gav );
+ assertEquals( "/foo1/foo1/0.0.1.SNAPSHOT/foo1-0.0.1.SNAPSHOT.pom", path );
+
+ // NEXUS-3148 ends
+
gav = gavCalculator.pathToGav( "/foo1/foo1/0.0.1-SNAPSHOT/foo1-0.0.1-SNAPSHOT-jdk14.jar" );
assertEquals( "foo1", gav.getGroupId() );
assertEquals( "foo1", gav.getArtifactId() );
@@ -679,5 +716,20 @@ public void testGavLooseStrictedSnapshot()
assertEquals( "pom", gav.getExtension() );
assertEquals( "1.0.20100111.064938-1", gav.getVersion() );
assertEquals( "1.0.SNAPSHOT", gav.getBaseVersion() );
+ assertEquals( "org.sonatype", gav.getGroupId() );
+ assertEquals( "nexus-3148", gav.getArtifactId() );
+ assertEquals( null, gav.getClassifier() );
+ assertEquals( "pom", gav.getExtension() );
+ assertEquals( new Integer(1), gav.getSnapshotBuildNumber() );
+ // the timestamp is UTC, not EST timezoned!
+ // also, the Gav is it seems TZ sensitive!!!
+ assertEquals( parseTimestamp("20100111.064938"), gav.getSnapshotTimeStamp() );
+ assertEquals( "nexus-3148-1.0.20100111.064938-1.pom", gav.getName() );
+ assertEquals( true, gav.isSnapshot() );
+ assertEquals( false, gav.isHash() );
+ assertEquals( null, gav.getHashType() );
+
+ String path = gavCalculator.gavToPath( gav );
+ assertEquals( "/org/sonatype/nexus-3148/1.0.SNAPSHOT/nexus-3148-1.0.20100111.064938-1.pom", path );
}
}
View
3  src/test/java/org/sonatype/nexus/artifact/MavenArtifactRecognizerTest.java
@@ -18,6 +18,9 @@ public void testIsPom() {
}
public void testIsSnapshot1() {
+ // NEXUS-3148
+ assertEquals(true, M2ArtifactRecognizer.isSnapshot("/org/somewhere/aid/1.0SNAPSHOT/xsdSNAPSHOT.jar"));
+
assertEquals(true, M2ArtifactRecognizer.isSnapshot("/org/somewhere/aid/1.0-SNAPSHOT/xsd-SNAPSHOT.jar"));
assertEquals(true, M2ArtifactRecognizer.isSnapshot("/org/somewhere/aid/1.0-SNAPSHOT/xsd-SNAPSHOT.pom"));
assertEquals(true, M2ArtifactRecognizer.isSnapshot("/org/somewhere/aid/1.0-SNAPSHOT/a/b/c/xsd-1.2.3-.pom"));
Please sign in to comment.
Something went wrong with that request. Please try again.