Skip to content

Commit b129c1d

Browse files
authored
Move from OSSRH to Central (#823)
1 parent 665ab98 commit b129c1d

File tree

3 files changed

+58
-59
lines changed

3 files changed

+58
-59
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
distribution: 'temurin'
1717
java-version: '8'
1818
cache: 'maven'
19-
server-id: ossrh
19+
server-id: central
2020
server-username: MAVEN_USERNAME
2121
server-password: MAVEN_CENTRAL_TOKEN
2222
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,26 +72,26 @@ If you're ready to contribute code, see [the contribution guide](CONTRIBUTING.md
7272

7373
Per-commit debug builds can be found on [CircleCI](https://circleci.com/gh/getodk/javarosa). Login with your GitHub account, click the build you'd like, then find the JAR in the Artifacts tab under $CIRCLE_ARTIFACTS.
7474

75-
### Publishing the jar to OSSRH and Maven Central
75+
### Publishing the jar to Central Repository and Maven Central
7676

77-
Project maintainers have the private keys to upload signed jars to Sonatype's OSS Repository Hosting (OSSRH) service which is then synced to Maven's Central Repository. This process is [outlined here](http://central.sonatype.org/pages/apache-maven.html).
77+
Project maintainers have the private keys to upload signed jars to Sonatype's Central Repository which is then synced to Maven Central. This process is [outlined here](https://central.sonatype.org).
7878

79-
While Gradle is the default build tool for all ODK tools (including this one), Maven is used for for publishing the jar because OSSRH's Gradle support is unreliable (e.g., snapshots don't always update). This means version and dependency changes must be made in both `build.gradle` and `pom.xml`.
79+
While Gradle is the default build tool for all ODK tools (including this one), Maven is used for for publishing the jar because Sonatype's Gradle support is unreliable (e.g., snapshots don't always update). This means version and dependency changes must be made in both `build.gradle` and `pom.xml`.
8080

81-
Deviations from OSSRH's documentation are that maintainers use `gpg2` v2.1 and greater (not `gpg`), the latest versions of the Maven plugins in `pom.xml`, and a `secrets.xml` file that include the GPG home directory, key name, and pass phrase. All that is needed in the GPG home directory is `private-keys-v1.d` and `pubring.gpg`.
81+
Deviations from Sonatype's documentation are that maintainers use `gpg2` v2.1 and greater (not `gpg`), the latest versions of the Maven plugins in `pom.xml`, and a `secrets.xml` file that include the GPG home directory, key name, and pass phrase. All that is needed in the GPG home directory is `private-keys-v1.d` and `pubring.gpg`.
8282
```
8383
<!-- secrets.xml -->
8484
<settings>
8585
<servers>
8686
<server>
87-
<id>ossrh</id>
87+
<id>central</id>
8888
<username>getodk</username>
8989
<password>very-secure-password</password>
9090
</server>
9191
</servers>
9292
<profiles>
9393
<profile>
94-
<id>ossrh</id>
94+
<id>central</id>
9595
<activation>
9696
<activeByDefault>true</activeByDefault>
9797
</activation>
@@ -108,13 +108,13 @@ Deviations from OSSRH's documentation are that maintainers use `gpg2` v2.1 and g
108108

109109
Official releases are built by a Github action when a commit is tagged. Before tagging a release:
110110

111-
1. Update the version in `build.gradle` and `pom.xml` and merge the changes to master.
111+
1. Update the version in `pom.xml` and merge the changes to master.
112112
* Use `x.x.x-SNAPSHOT` for snapshots releases and `x.x.x` for production releases.
113113

114114
To manually generate official signed releases, you'll need the GPG folder, GPG passwords, a configured `secrets.xml` file.
115115
1. Run `mvn -v` to confirm the Java version and vendor used to build the release.
116116
1. In the repo folder, run `mvn -s secrets.xml clean deploy` to publish.
117-
* If successful, both snapshots and production releases will appear in OSSRH [here](https://oss.sonatype.org/content/groups/public/org/getodk/javarosa/).
118-
* Production releases are automatically synced to Central [here](https://search.maven.org/#search%7Cga%7C1%7Ca%3A%22javarosa%22) a few hours later.
117+
* If successful, both snapshots and production releases will appear in Sonatype [here](https://central.sonatype.com/artifact/org.getodk/javarosa).
118+
* Production releases are automatically synced to Maven [here](https://search.maven.org/#search%7Cga%7C1%7Ca%3A%22javarosa%22) a few hours later.
119119

120120
Don't forget to update the `build.gradle` files in any downstream tools (e.g., ODK Collect, ODK Briefcase) to the newest version!

pom.xml

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
</scm>
3131
<distributionManagement>
3232
<snapshotRepository>
33-
<id>ossrh</id>
34-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
33+
<id>central</id>
34+
<url>https://central.sonatype.com/repository/maven-snapshots</url>
3535
</snapshotRepository>
3636
<repository>
37-
<id>ossrh</id>
38-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
37+
<id>central</id>
38+
<url>https://central.sonatype.com</url>
3939
</repository>
4040
</distributionManagement>
4141
<properties>
@@ -194,55 +194,54 @@
194194
</executions>
195195
</plugin>
196196
<plugin>
197-
<groupId>org.sonatype.plugins</groupId>
198-
<artifactId>nexus-staging-maven-plugin</artifactId>
199-
<version>1.6.8</version>
197+
<groupId>org.sonatype.central</groupId>
198+
<artifactId>central-publishing-maven-plugin</artifactId>
199+
<version>0.7.0</version>
200200
<extensions>true</extensions>
201201
<configuration>
202-
<serverId>ossrh</serverId>
203-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
204-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
202+
<publishingServerId>central</publishingServerId>
203+
<autoPublish>true</autoPublish>
205204
</configuration>
206205
</plugin>
207-
<plugin>
208-
<groupId>org.jetbrains.kotlin</groupId>
209-
<artifactId>kotlin-maven-plugin</artifactId>
210-
<version>1.6.10</version>
211-
<executions>
212-
<execution>
213-
<id>compile</id>
214-
<phase>compile</phase>
215-
<goals>
216-
<goal>compile</goal>
217-
</goals>
218-
</execution>
219-
</executions>
220-
</plugin>
221-
<plugin>
222-
<groupId>org.codehaus.mojo</groupId>
223-
<artifactId>flatten-maven-plugin</artifactId>
224-
<version>1.6.0</version>
225-
<configuration>
226-
<updatePomFile>true</updatePomFile>
227-
<flattenMode>resolveCiFriendliesOnly</flattenMode>
228-
</configuration>
229-
<executions>
230-
<execution>
231-
<id>flatten</id>
232-
<phase>process-resources</phase>
233-
<goals>
234-
<goal>flatten</goal>
235-
</goals>
236-
</execution>
237-
<execution>
238-
<id>flatten.clean</id>
239-
<phase>clean</phase>
240-
<goals>
241-
<goal>clean</goal>
242-
</goals>
243-
</execution>
244-
</executions>
245-
</plugin>
206+
<plugin>
207+
<groupId>org.jetbrains.kotlin</groupId>
208+
<artifactId>kotlin-maven-plugin</artifactId>
209+
<version>1.6.10</version>
210+
<executions>
211+
<execution>
212+
<id>compile</id>
213+
<phase>compile</phase>
214+
<goals>
215+
<goal>compile</goal>
216+
</goals>
217+
</execution>
218+
</executions>
219+
</plugin>
220+
<plugin>
221+
<groupId>org.codehaus.mojo</groupId>
222+
<artifactId>flatten-maven-plugin</artifactId>
223+
<version>1.6.0</version>
224+
<configuration>
225+
<updatePomFile>true</updatePomFile>
226+
<flattenMode>resolveCiFriendliesOnly</flattenMode>
227+
</configuration>
228+
<executions>
229+
<execution>
230+
<id>flatten</id>
231+
<phase>process-resources</phase>
232+
<goals>
233+
<goal>flatten</goal>
234+
</goals>
235+
</execution>
236+
<execution>
237+
<id>flatten.clean</id>
238+
<phase>clean</phase>
239+
<goals>
240+
<goal>clean</goal>
241+
</goals>
242+
</execution>
243+
</executions>
244+
</plugin>
246245
</plugins>
247246
</build>
248247
</project>

0 commit comments

Comments
 (0)