From c3a1eef5729cb9cdc99727258e6becf544e66311 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Thu, 2 May 2024 15:19:16 -0500 Subject: [PATCH] Remove all appends of -SNAPSHOT --- .../rubygems/DefaultRubygemsFileFactory.java | 4 +- .../mojo/rubygems/MetadataBuilder.java | 6 +- .../rubygems/layout/DefaultLayoutTest.java | 6 +- .../test/resources/metadata-prereleases.xml | 86 +++++++++---------- .../resources/psych-prerelease-metadata.xml | 24 +++--- 5 files changed, 63 insertions(+), 63 deletions(-) diff --git a/rubygems-tools/src/main/java/org/torquebox/mojo/rubygems/DefaultRubygemsFileFactory.java b/rubygems-tools/src/main/java/org/torquebox/mojo/rubygems/DefaultRubygemsFileFactory.java index bb8a588..e451e74 100644 --- a/rubygems-tools/src/main/java/org/torquebox/mojo/rubygems/DefaultRubygemsFileFactory.java +++ b/rubygems-tools/src/main/java/org/torquebox/mojo/rubygems/DefaultRubygemsFileFactory.java @@ -62,7 +62,7 @@ private String join(String... parts) { private String toPath(String name, String version, String timestamp, boolean snapshot) { String v1 = snapshot ? version + "-" + timestamp : version; - String v2 = snapshot ? version + MavenPrereleasesRubygemsArtifactIdCuba.SNAPSHOT : version; + String v2 = version; return join(snapshot ? MAVEN_PRERELEASED_RUBYGEMS : MAVEN_RELEASED_RUBYGEMS, SEPARATOR, name, SEPARATOR, v2, SEPARATOR, name + '-' + v1); } @@ -103,7 +103,7 @@ public GemArtifactFile gemArtifact(String name, String version) { @Override public MavenMetadataSnapshotFile mavenMetadataSnapshot(String name, String version) { - String path = join(MAVEN_PRERELEASED_RUBYGEMS, SEPARATOR, name, SEPARATOR, version + MavenPrereleasesRubygemsArtifactIdCuba.SNAPSHOT, SEPARATOR, MavenReleasesRubygemsArtifactIdCuba.MAVEN_METADATA_XML); + String path = join(MAVEN_PRERELEASED_RUBYGEMS, SEPARATOR, name, SEPARATOR, version, SEPARATOR, MavenReleasesRubygemsArtifactIdCuba.MAVEN_METADATA_XML); return new MavenMetadataSnapshotFile(this, path, name, version); } diff --git a/rubygems-tools/src/main/java/org/torquebox/mojo/rubygems/MetadataBuilder.java b/rubygems-tools/src/main/java/org/torquebox/mojo/rubygems/MetadataBuilder.java index 9b6a773..7108771 100644 --- a/rubygems-tools/src/main/java/org/torquebox/mojo/rubygems/MetadataBuilder.java +++ b/rubygems-tools/src/main/java/org/torquebox/mojo/rubygems/MetadataBuilder.java @@ -33,9 +33,9 @@ public MetadataBuilder(DependencyData deps) { public void appendVersions(boolean isPrerelease) { for (String version : deps.versions(isPrerelease)) { xml.append(" ").append(version); - if (isPrerelease) { - xml.append("-SNAPSHOT"); - } +// if (isPrerelease) { +// xml.append("-SNAPSHOT"); +// } xml.append("\n"); } } diff --git a/rubygems-tools/src/test/java/org/torquebox/mojo/rubygems/layout/DefaultLayoutTest.java b/rubygems-tools/src/test/java/org/torquebox/mojo/rubygems/layout/DefaultLayoutTest.java index 82e718f..68bd7c8 100644 --- a/rubygems-tools/src/test/java/org/torquebox/mojo/rubygems/layout/DefaultLayoutTest.java +++ b/rubygems-tools/src/test/java/org/torquebox/mojo/rubygems/layout/DefaultLayoutTest.java @@ -71,7 +71,7 @@ public void testGemArtifact() throws Exception { @Test public void testGemSnapshotArtifact() throws Exception { - String path = "/maven/prereleases/rubygems/jbundler/1.2.3-SNAPSHOT/jbundler-1.2.3-123123123.gem"; + String path = "/maven/prereleases/rubygems/jbundler/1.2.3/jbundler-1.2.3-123123123.gem"; RubygemsFile file = fileSystem.get(path); assertThat(file, notNullValue()); RubygemsFile file2 = fileSystem.get(path); @@ -114,7 +114,7 @@ public void testPomRelease() throws Exception { @Test public void testPomSnapshot() throws Exception { - String path = "/maven/prereleases/rubygems/jbundler/1.2.3-SNAPSHOT/jbundler-1.2.3-123123123.pom"; + String path = "/maven/prereleases/rubygems/jbundler/1.2.3/jbundler-1.2.3-123123123.pom"; RubygemsFile file = fileSystem.get(path); assertThat(file, notNullValue()); RubygemsFile file2 = fileSystem.get(path); @@ -171,7 +171,7 @@ public void testMetadataXmlPrereleases() throws Exception { @Test public void testMetadataXmlSnapshots() throws Exception { - String path = "/maven/prereleases/rubygems/jbundler/9.2.3-SNAPSHOT/maven-metadata.xml"; + String path = "/maven/prereleases/rubygems/jbundler/9.2.3/maven-metadata.xml"; RubygemsFile file = fileSystem.get(path); assertThat(file, notNullValue()); RubygemsFile file2 = fileSystem.get(path); diff --git a/rubygems-tools/src/test/resources/metadata-prereleases.xml b/rubygems-tools/src/test/resources/metadata-prereleases.xml index 73da1fa..8eb6af0 100644 --- a/rubygems-tools/src/test/resources/metadata-prereleases.xml +++ b/rubygems-tools/src/test/resources/metadata-prereleases.xml @@ -3,49 +3,49 @@ nokogiri - 1.5.0.beta.1-SNAPSHOT - 1.5.0.beta.2-SNAPSHOT - 1.5.0.beta.3-SNAPSHOT - 1.5.0.beta.4-SNAPSHOT - 1.5.1.rc1-SNAPSHOT - 1.5.3.rc2-SNAPSHOT - 1.5.3.rc3-SNAPSHOT - 1.5.3.rc4-SNAPSHOT - 1.5.3.rc5-SNAPSHOT - 1.5.3.rc6-SNAPSHOT - 1.5.4.rc1-SNAPSHOT - 1.5.4.rc2-SNAPSHOT - 1.5.4.rc3-SNAPSHOT - 1.5.5.rc1-SNAPSHOT - 1.5.5.rc2-SNAPSHOT - 1.5.5.rc3-SNAPSHOT - 1.5.6.rc1-SNAPSHOT - 1.5.6.rc2-SNAPSHOT - 1.5.6.rc3-SNAPSHOT - 1.5.7.rc1-SNAPSHOT - 1.5.7.rc2-SNAPSHOT - 1.5.7.rc3-SNAPSHOT - 1.6.0.rc1-SNAPSHOT - 1.6.2.rc1-SNAPSHOT - 1.6.2.rc2-SNAPSHOT - 1.6.2.rc3-SNAPSHOT - 1.6.3.rc1-SNAPSHOT - 1.6.3.rc2-SNAPSHOT - 1.6.3.rc3-SNAPSHOT - 1.6.7.rc2-SNAPSHOT - 1.6.7.rc3-SNAPSHOT - 1.6.7.rc4-SNAPSHOT - 1.6.8.rc1-SNAPSHOT - 1.6.8.rc2-SNAPSHOT - 1.6.8.rc3-SNAPSHOT - 1.9.0.rc1-SNAPSHOT - 1.10.0.rc1-SNAPSHOT - 1.11.0.rc1-SNAPSHOT - 1.11.0.rc2-SNAPSHOT - 1.11.0.rc3-SNAPSHOT - 1.11.0.rc4-SNAPSHOT - 1.12.0.rc1-SNAPSHOT - 1.14.0.rc1-SNAPSHOT + 1.5.0.beta.1 + 1.5.0.beta.2 + 1.5.0.beta.3 + 1.5.0.beta.4 + 1.5.1.rc1 + 1.5.3.rc2 + 1.5.3.rc3 + 1.5.3.rc4 + 1.5.3.rc5 + 1.5.3.rc6 + 1.5.4.rc1 + 1.5.4.rc2 + 1.5.4.rc3 + 1.5.5.rc1 + 1.5.5.rc2 + 1.5.5.rc3 + 1.5.6.rc1 + 1.5.6.rc2 + 1.5.6.rc3 + 1.5.7.rc1 + 1.5.7.rc2 + 1.5.7.rc3 + 1.6.0.rc1 + 1.6.2.rc1 + 1.6.2.rc2 + 1.6.2.rc3 + 1.6.3.rc1 + 1.6.3.rc2 + 1.6.3.rc3 + 1.6.7.rc2 + 1.6.7.rc3 + 1.6.7.rc4 + 1.6.8.rc1 + 1.6.8.rc2 + 1.6.8.rc3 + 1.9.0.rc1 + 1.10.0.rc1 + 1.11.0.rc1 + 1.11.0.rc2 + 1.11.0.rc3 + 1.11.0.rc4 + 1.12.0.rc1 + 1.14.0.rc1 20140416150033 diff --git a/rubygems-tools/src/test/resources/psych-prerelease-metadata.xml b/rubygems-tools/src/test/resources/psych-prerelease-metadata.xml index cb01e35..b381921 100644 --- a/rubygems-tools/src/test/resources/psych-prerelease-metadata.xml +++ b/rubygems-tools/src/test/resources/psych-prerelease-metadata.xml @@ -3,18 +3,18 @@ psych - 1.2.2.rc1-SNAPSHOT - 2.0.14.pre1-SNAPSHOT - 3.0.0.beta2-SNAPSHOT - 3.0.0.beta3-SNAPSHOT - 3.0.0.beta4-SNAPSHOT - 3.0.3.pre1-SNAPSHOT - 3.0.3.pre2-SNAPSHOT - 3.0.3.pre3-SNAPSHOT - 3.0.3.pre4-SNAPSHOT - 3.0.3.pre5-SNAPSHOT - 5.0.2.pre1-SNAPSHOT - 5.1.0.pre1-SNAPSHOT + 1.2.2.rc1 + 2.0.14.pre1 + 3.0.0.beta2 + 3.0.0.beta3 + 3.0.0.beta4 + 3.0.3.pre1 + 3.0.3.pre2 + 3.0.3.pre3 + 3.0.3.pre4 + 3.0.3.pre5 + 5.0.2.pre1 + 5.1.0.pre1 2014