Skip to content

Commit 923b56e

Browse files
authored
migrate to sonatype central (#144)
* Build Fixes/Improvements - Update URLs to https Signed-off-by: Phillip Ross <[email protected]> * Migrate from OSSRH publishing to Sonatype Central Portal publishing --------- Signed-off-by: Phillip Ross <[email protected]>
1 parent 652fddb commit 923b56e

File tree

3 files changed

+48
-61
lines changed

3 files changed

+48
-61
lines changed

.github/settings.xml

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
44
<servers>
55
<server>
6-
<id>ossrh</id>
7-
<username>${env.OSSRHU}</username>
8-
<password>${env.OSSRHT}</password>
6+
<id>sonatype-central-portal</id>
7+
<username>${env.SONATYPE_CENTRAL_PORTAL_REPO_USERNAME}</username>
8+
<password>${env.SONATYPE_CENTRAL_PORTAL_REPO_PASSWORD}</password>
99
</server>
1010
</servers>
1111
<profiles>
@@ -16,44 +16,17 @@
1616
</properties>
1717
</profile>
1818
<profile>
19-
<id>sonatype-snapshots</id>
19+
<id>sonatype-central-snapshots</id>
2020
<repositories>
2121
<repository>
22-
<id>sonatype-snapshots</id>
22+
<id>sonatype-central-snapshots</id>
2323
<snapshots>
2424
<enabled>true</enabled>
2525
</snapshots>
26-
<name>sonatype-snapshots</name>
27-
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
28-
</repository>
29-
</repositories>
30-
</profile>
31-
<profile>
32-
<id>sonatype-staging</id>
33-
<repositories>
34-
<repository>
35-
<id>sonatype-staging</id>
36-
<snapshots>
37-
<enabled>true</enabled>
38-
</snapshots>
39-
<name>sonatype-staging</name>
40-
<url>https://oss.sonatype.org/content/groups/staging/</url>
41-
</repository>
42-
</repositories>
43-
</profile>
44-
<profile>
45-
<id>sonatype-releases</id>
46-
<repositories>
47-
<repository>
48-
<id>sonatype-releases</id>
49-
<snapshots>
50-
<enabled>true</enabled>
51-
</snapshots>
52-
<name>sonatype-releases</name>
53-
<url>https://oss.sonatype.org/content/groups/public/</url>
26+
<name>sonatype-central-snapshots</name>
27+
<url>https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/snapshots/</url>
5428
</repository>
5529
</repositories>
5630
</profile>
5731
</profiles>
58-
5932
</settings>

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: ${{ matrix.os }}
2626
env:
2727
MAVEN_PROPS: -Djavadoc.path=`which javadoc`
28-
PROFILES: gpg,release-sign-artifacts,sonatype-deployment,sonatype-snapshots,sonatype-staging,sonatype-releases
28+
PROFILES: "gpg,release-sign-artifacts,sonatype-central-portal-deployment,sonatype-central-snapshots"
2929
SETTINGS: .github/settings.xml
3030

3131
steps:
@@ -82,8 +82,8 @@ jobs:
8282
- name: Maven deploy
8383
if: ${{ matrix.maven_deploy && (github.ref == 'refs/heads/main') && (github.event_name != 'pull_request') }}
8484
env:
85-
OSSRHU: ${{ secrets.OSSRHU }}
86-
OSSRHT: ${{ secrets.OSSRHT }}
85+
SONATYPE_CENTRAL_PORTAL_REPO_USERNAME: ${{ secrets.SONATYPE_CENTRAL_PORTAL_REPO_USERNAME }}
86+
SONATYPE_CENTRAL_PORTAL_REPO_PASSWORD: ${{ secrets.SONATYPE_CENTRAL_PORTAL_REPO_PASSWORD }}
8787
run: ./mvnw -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} deploy
8888

8989
- name: Docker maven build

pom.xml

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99

1010
<name>PostGIS Java Project</name>
1111
<description>Aggregates java projects associated with the PostGIS project.</description>
12-
<url>http://postgis.net</url>
12+
<url>https://postgis.net</url>
1313
<licenses>
1414
<license>
1515
<name>GNU Lesser General Public License</name>
16-
<url>http://www.gnu.org/licenses/lgpl-2.1.txt</url>
16+
<url>https://www.gnu.org/licenses/lgpl-2.1.txt</url>
1717
<distribution>repo</distribution>
1818
</license>
1919
</licenses>
2020

2121
<developers>
2222
<developer>
2323
<name>PostGIS Development Team</name>
24-
<url>http://postgis.net</url>
24+
<url>https://postgis.net</url>
2525
</developer>
2626
<developer>
2727
<name>Phillip Ross</name>
@@ -35,15 +35,14 @@
3535
<contributor>
3636
<name>Hakan Tandogan</name>
3737
<email>[email protected]</email>
38-
<url>http://www.gurkensalat.com/</url>
38+
<url>https://www.gurkensalat.com/</url>
3939
<roles>
4040
<role>Maven Packager</role>
4141
</roles>
4242
</contributor>
4343
<contributor>
4444
<name>Baris Ergun</name>
4545
<email>[email protected]</email>
46-
<url>http://www.barisergun.com/</url>
4746
<roles>
4847
<role>Maven Packager</role>
4948
</roles>
@@ -56,14 +55,14 @@
5655
<subscribe>[email protected]</subscribe>
5756
<unsubscribe>[email protected]</unsubscribe>
5857
<post>[email protected]</post>
59-
<archive>http://lists.osgeo.org/pipermail/postgis-users/</archive>
58+
<archive>https://lists.osgeo.org/pipermail/postgis-users/</archive>
6059
</mailingList>
6160
<mailingList>
6261
<name>Developer List</name>
6362
<subscribe>[email protected]</subscribe>
6463
<unsubscribe>[email protected]</unsubscribe>
6564
<post>[email protected]</post>
66-
<archive>http://lists.osgeo.org/pipermail/postgis-devel/</archive>
65+
<archive>https://lists.osgeo.org/pipermail/postgis-devel/</archive>
6766
</mailingList>
6867
</mailingLists>
6968

@@ -88,7 +87,7 @@
8887
<distributionManagement>
8988
<site>
9089
<id>local-staging-site</id>
91-
<url>http://local-staging/</url>
90+
<url>https://local-staging/</url>
9291
</site>
9392
</distributionManagement>
9493

@@ -462,7 +461,7 @@
462461
<autoVersionSubmodules>true</autoVersionSubmodules>
463462
<localCheckout>true</localCheckout>
464463
<pushChanges>false</pushChanges>
465-
<releaseProfiles>release-sign-artifacts,sonatype-deployment</releaseProfiles>
464+
<releaseProfiles>release-sign-artifacts,sonatype-central-portal-deployment</releaseProfiles>
466465
</configuration>
467466
</plugin>
468467
<plugin>
@@ -860,10 +859,10 @@
860859
</build>
861860
</profile>
862861
<!--
863-
The release-sign-artifacts and sonatype deployment profiles only need activated when pushing snapshots or
864-
releases to maven central. When enabled, additional artifacts will be generated for javadoc and source as well
865-
as GPG signatures for each artifact. This profiles assume that the properties for the gpg plugin
866-
(such as gpg.keyname and gpg.passphrase are either defined in a settings.xml file or similar facility.
862+
The release-sign-artifacts and sonatype-central-portal-deployment profiles only need activated when pushing
863+
snapshots or releases to maven central. When enabled, additional artifacts will be generated for javadoc and
864+
source as well as GPG signatures for each artifact. These profiles assume that the properties for the gpg
865+
plugin (such as gpg.keyname and gpg.passphrase) are either defined in a settings.xml file or similar facility.
867866
-->
868867
<profile>
869868
<id>release-sign-artifacts</id>
@@ -910,17 +909,32 @@
910909
</build>
911910
</profile>
912911
<profile>
913-
<id>sonatype-deployment</id>
914-
<distributionManagement>
915-
<snapshotRepository>
916-
<id>ossrh</id>
917-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
918-
</snapshotRepository>
919-
<repository>
920-
<id>ossrh</id>
921-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
922-
</repository>
923-
</distributionManagement>
912+
<id>sonatype-central-portal-deployment</id>
913+
<properties>
914+
<central-publishing-maven-plugin.version>0.7.0</central-publishing-maven-plugin.version>
915+
</properties>
916+
<build>
917+
<pluginManagement>
918+
<plugins>
919+
<plugin>
920+
<groupId>org.sonatype.central</groupId>
921+
<artifactId>central-publishing-maven-plugin</artifactId>
922+
<version>${central-publishing-maven-plugin.version}</version>
923+
<extensions>true</extensions>
924+
<configuration>
925+
<!-- publishing server id refers to <id> element in <server> section of settings.xml -->
926+
<publishingServerId>sonatype-central-portal</publishingServerId>
927+
</configuration>
928+
</plugin>
929+
</plugins>
930+
</pluginManagement>
931+
<plugins>
932+
<plugin>
933+
<groupId>org.sonatype.central</groupId>
934+
<artifactId>central-publishing-maven-plugin</artifactId>
935+
</plugin>
936+
</plugins>
937+
</build>
924938
</profile>
925939

926940
<profile>

0 commit comments

Comments
 (0)