Skip to content

Commit 5bd0595

Browse files
authored
Merge pull request #11774 from IQSS/11766-11512-spi
make dataverse-spi snapshots possible, add docs for publishing snapshots from local
2 parents 862522e + f570aaa commit 5bd0595

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

.github/workflows/spi_release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
with:
4343
java-version: '17'
4444
distribution: 'adopt'
45+
# TODO: change this from ossrh to central?
4546
server-id: ossrh
4647
server-username: MAVEN_USERNAME
4748
server-password: MAVEN_PASSWORD
@@ -80,6 +81,7 @@ jobs:
8081
with:
8182
java-version: '17'
8283
distribution: 'adopt'
84+
# TODO: change this from ossrh to central?
8385
server-id: ossrh
8486
server-username: MAVEN_USERNAME
8587
server-password: MAVEN_PASSWORD

doc/sphinx-guides/source/developers/making-library-releases.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,32 @@ Releasing a Snapshot Version to Maven Central
3636

3737
That is to say, to make a snapshot release, you only need to get one or more commits into the default branch.
3838

39+
It's possible, of course, to make snapshot releases outside of GitHub Actions, from environments such as your laptop. Generally, you'll want to look at the GitHub Action and try to do the equivalent. You'll need a file set up locally at ``~/.m2/settings.xml`` with the following (contact a core developer for the redacted bits):
40+
41+
.. code-block:: bash
42+
43+
<settings>
44+
<servers>
45+
<server>
46+
<id>central</id>
47+
<username>REDACTED</username>
48+
<password>REDACTED</password>
49+
</server>
50+
</servers>
51+
</settings>
52+
53+
Then, study the GitHub Action and perform similar commands from your local environment. For example, as of this writing, for the dataverse-spi project, you can run the following commands, substituting the suffix you need:
54+
55+
``mvn -f modules/dataverse-spi -Dproject.version.suffix="2.1.0-PR11767-SNAPSHOT" verify``
56+
57+
``mvn -f modules/dataverse-spi -Dproject.version.suffix="2.1.0-PR11767-SNAPSHOT" deploy``
58+
59+
This will upload the snapshot here, for example: https://central.sonatype.com/repository/maven-snapshots/io/gdcc/dataverse-spi/2.1.02.1.0-PR11767-SNAPSHOT/dataverse-spi-2.1.02.1.0-PR11767-20250827.182026-1.jar
60+
61+
Before OSSRH was retired, you could browse through snapshot jars you published at https://s01.oss.sonatype.org/content/repositories/snapshots/io/gdcc/dataverse-spi/2.0.0-PR9685-SNAPSHOT/, for example. Now, even though you may see the URL of the jar as shown above during the "deploy" step, if you try to browse the various snapshot jars at https://central.sonatype.com/repository/maven-snapshots/io/gdcc/dataverse-spi/2.1.02.1.0-PR11767-SNAPSHOT/ you'll see "This maven2 hosted repository is not directly browseable at this URL. Please use the browse or HTML index views to inspect the contents of this repository." Sadly, the "browse" and "HTML index" links don't work, as noted in a `question <https://community.sonatype.com/t/this-maven2-group-repository-is-not-directly-browseable-at-this-url/8991>`_ on the Sonatype Community forum. Below is a suggestion for confirming that the jar was uploaded properly, which is to use Maven to copy the jar to your local directory. You could then compare checksums.
62+
63+
``mvn dependency:copy -DrepoUrl=https://central.sonatype.com/repository/maven-snapshots/ -Dartifact=io.gdcc:dataverse-spi:2.1.02.1.0-PR11767-SNAPSHOT -DoutputDirectory=.``
64+
3965
Releasing a Release (Non-Snapshot) Version to Maven Central
4066
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4167

modules/dataverse-spi/pom.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,13 @@
6464

6565
<distributionManagement>
6666
<snapshotRepository>
67-
<id>ossrh</id>
68-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
67+
<id>central</id>
68+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
6969
</snapshotRepository>
7070
<repository>
71+
<!--TODO: change this from ossrh to central?-->
7172
<id>ossrh</id>
73+
<!--TODO: change this url?-->
7274
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
7375
</repository>
7476
</distributionManagement>
@@ -110,7 +112,9 @@
110112
<artifactId>nexus-staging-maven-plugin</artifactId>
111113
<extensions>true</extensions>
112114
<configuration>
115+
<!--TODO: change this from ossrh to central?-->
113116
<serverId>ossrh</serverId>
117+
<!--TODO: change this URL?-->
114118
<nexusUrl>https://s01.oss.sonatype.org</nexusUrl>
115119
<autoReleaseAfterClose>true</autoReleaseAfterClose>
116120
</configuration>

0 commit comments

Comments
 (0)