Skip to content

Commit 9b13510

Browse files
authored
Upgrade maven central deployment plugins and settings (#111)
* Upgrade maven central deployment plugins and settings * Update workflow to use org secrets * Update dependents query * Update release workflow * Add name properties to pom * Change type to pom * Add type <pom> in dependents of pom-typed dependencies
1 parent 43e7a54 commit 9b13510

File tree

24 files changed

+57
-44
lines changed

24 files changed

+57
-44
lines changed

.github/workflows/release-and-deploy.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
name: Release and deploy to Sonatype staging repo
66
env:
77
GITHUB_PAT: ${{ secrets.QUDTLIB_BOT_GITHUB_TOKEN }}
8-
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
8+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
99
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
1010
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
1111
on:
@@ -19,10 +19,6 @@ on:
1919
description: 'Next SNAPSHOT version (such as 2.4-SNAPSHOT)'
2020
required: true
2121
type: string
22-
environment:
23-
description: 'Environment to run tests against'
24-
type: environment
25-
required: true
2622
secrets:
2723
QUDTLIB_BOT_GITHUB_TOKEN:
2824
required: true
@@ -35,8 +31,6 @@ on:
3531

3632
jobs:
3733
build:
38-
# setting the environment on the job is mandatory, otherwise it cannot access environment secrets.
39-
environment: ${{ inputs.environment }}
4034
runs-on: ubuntu-latest
4135

4236
steps:

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Changed
1111

12+
- when using `qudtlib` as a dependency, you have to add `<type>pom</type>` (see updatede [`README.md`](README.md)). This is due to more rigorous
13+
artifact checks by sonatype that prevent jar artifacts without sources.
1214
- Upgrade to QUDT 3.1.4
1315
- Calculation of scalings and factor units now happens in QUDT (see PR [1129](https://github.com/qudt/qudt-public-repo/pull/1129))
1416
However, a few things have changed:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Maven dependency:
3131
<groupId>io.github.qudtlib</groupId>
3232
<artifactId>qudtlib</artifactId>
3333
<version>${project.version}</version> <!-- remember to use the latest version -->
34+
<type>pom</type>
3435
</dependency>
3536
```
3637

pom.xml

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,15 @@
124124
<groupId>org.apache.maven.plugins</groupId>
125125
<artifactId>maven-deploy-plugin</artifactId>
126126
<version>3.0.0</version>
127+
<executions>
128+
<execution>
129+
<id>default-deploy</id>
130+
<phase>none</phase>
131+
</execution>
132+
</executions>
133+
<configuration>
134+
<skip>true</skip>
135+
</configuration>
127136
</plugin>
128137
<plugin>
129138
<groupId>org.apache.maven.plugins</groupId>
@@ -160,22 +169,6 @@
160169
<artifactId>wagon-maven-plugin</artifactId>
161170
<version>2.0.0</version>
162171
</plugin>
163-
<plugin>
164-
<!--
165-
configuring nexus plugin for manual deployment after
166-
release with maven-release/deploy-plugin, see
167-
https://central.sonatype.org/publish/publish-maven/#manually-releasing-the-deployment-to-the-central-repository
168-
-->
169-
<groupId>org.sonatype.plugins</groupId>
170-
<artifactId>nexus-staging-maven-plugin</artifactId>
171-
<version>1.6.8</version>
172-
<extensions>true</extensions>
173-
<configuration>
174-
<serverId>ossrh</serverId>
175-
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
176-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
177-
</configuration>
178-
</plugin>
179172
</plugins>
180173
</pluginManagement>
181174
<plugins>
@@ -282,6 +275,24 @@
282275
</activation>
283276
<build>
284277
<plugins>
278+
<plugin>
279+
<groupId>org.sonatype.central</groupId>
280+
<artifactId>central-publishing-maven-plugin</artifactId>
281+
<version>0.8.0</version>
282+
<extensions>true</extensions>
283+
<configuration>
284+
<publishingServerId>ossrh</publishingServerId>
285+
</configuration>
286+
<executions>
287+
<execution>
288+
<id>publish-to-central</id>
289+
<phase>deploy</phase>
290+
<goals>
291+
<goal>publish</goal>
292+
</goals>
293+
</execution>
294+
</executions>
295+
</plugin>
285296
<plugin>
286297
<groupId>org.apache.maven.plugins</groupId>
287298
<artifactId>maven-gpg-plugin</artifactId>
@@ -341,11 +352,11 @@
341352
<distributionManagement>
342353
<snapshotRepository>
343354
<id>ossrh</id>
344-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
355+
<url>https://ossrh-staging-api.central.sonatype.com/content/repositories/snapshots</url>
345356
</snapshotRepository>
346357
<repository>
347358
<id>ossrh</id>
348-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
359+
<url>https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/</url>
349360
</repository>
350361
</distributionManagement>
351362
</project>

qudtlib-common-codegen/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<groupId>io.github.qudtlib</groupId>
66
<version>6.8.2-SNAPSHOT</version>
77
</parent>
8+
<name>qudtlib-common-codegen</name>
89
<modelVersion>4.0.0</modelVersion>
910

1011
<artifactId>qudtlib-common-codegen</artifactId>

qudtlib-common-rdf/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<version>6.8.2-SNAPSHOT</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
9-
9+
<name>qudtlib-common-rdf</name>
1010
<artifactId>qudtlib-common-rdf</artifactId>
1111

1212
<dependencies>

qudtlib-constants-gen/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>qudtlib-constants-gen</artifactId>
1010
<packaging>jar</packaging>
11-
11+
<name>qudtlib-constants-gen</name>
1212
<dependencies>
1313
<dependency>
1414
<groupId>io.github.qudtlib</groupId>

qudtlib-data-gen/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>qudtlib-data-gen</artifactId>
1010
<packaging>jar</packaging>
11+
<name>qudtlib-data-gen</name>
1112
<dependencies>
1213
<dependency>
1314
<groupId>io.github.qudtlib</groupId>

qudtlib-data-gen/src/main/resources/update-units-by-query1.rq

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ INSERT {
99
WHERE
1010
{
1111
{
12-
?other
13-
qudt:hasFactorUnit [
14-
qudt:hasUnit ?unit ;
15-
] ;
12+
?other ( qudt:hasFactorUnit/qudt:hasUnit )+ ?unit ;
1613
} UNION {
1714
?other
1815
qudt:scalingOf ?unit

qudtlib-data/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>qudtlib-data</artifactId>
1010
<packaging>jar</packaging>
11+
<name>qudtlib-data</name>
1112

1213
<properties>
1314
<qudtlib.generate.dir>${project.build.directory}/generated-resources/qudtlib</qudtlib.generate.dir>

0 commit comments

Comments
 (0)