Skip to content

Commit 0a7f93e

Browse files
committed
Use Njord for publishing with Central Portal
1 parent b7d4423 commit 0a7f93e

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

.github/workflows/maven.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
distribution: 'temurin'
6060
java-version: ${{ matrix.jdk }}
6161
# generate settings.xml with the correct values
62-
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
62+
server-id: sonatype-central-portal # Value of the distributionManagement/repository/id field of the pom.xml
6363
server-username: MAVEN_USERNAME # env variable for username in deploy
6464
server-password: MAVEN_PASSWORD # env variable for token in deploy
6565

@@ -70,8 +70,8 @@ jobs:
7070
if [ "${{ matrix.isMainBuildEnv }}" = "true" ]; then
7171
echo "MVN_ADDITIONAL_OPTS=-Dsonar.projectKey=Netcentric_aem-content-package-namespace-validators -Dsonar.organization=netcentric -Dsonar.host.url=https://sonarcloud.io -Pjacoco-report" >> $GITHUB_ENV
7272
if [ "${{github.ref}}" = "refs/heads/main" ] && [ "${{github.event_name}}" = "push" ]; then
73-
echo "MAVEN_USERNAME=${{ secrets.OSSRH_TOKEN_USER }}" >> $GITHUB_ENV
74-
echo "MAVEN_PASSWORD=${{ secrets.OSSRH_TOKEN_PASSWORD }}" >> $GITHUB_ENV
73+
echo "MAVEN_USERNAME=${{ secrets.SONATYPE_CENTRAL_TOKEN_USER }}" >> $GITHUB_ENV
74+
echo "MAVEN_PASSWORD=${{ secrets.SONATYPE_CENTRAL_TOKEN_PASSWORD }}" >> $GITHUB_ENV
7575
echo "MVN_GOAL=clean deploy org.sonarsource.scanner.maven:sonar-maven-plugin:sonar" >> $GITHUB_ENV
7676
echo "STEP_NAME_SUFFIX=(Deploys to OSSRH)" >> $GITHUB_ENV
7777
else

pom.xml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,20 @@
3939
</scm>
4040
<distributionManagement>
4141
<repository>
42-
<id>ossrh</id>
43-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
42+
<id>sonatype-central-portal</id>
43+
<url>https://repo.maven.apache.org/maven2</url>
4444
</repository>
4545
<snapshotRepository>
46-
<id>ossrh</id>
47-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
46+
<id>sonatype-central-portal</id>
47+
<url>https://central.sonatype.com/repository/maven-snapshots</url>
4848
</snapshotRepository>
4949
</distributionManagement>
5050

5151
<properties>
52-
<maven.version>3.6.3</maven.version>
52+
<!-- required for njord-->
53+
<maven.version>3.9.0</maven.version>
5354
<java.target.version>8</java.target.version>
55+
<njord.version>0.8.4</njord.version>
5456
<!-- used for compiler plugin, javadoc plugin and animal-sniffer, for compatibility reasons with Java 9 only the values 6,7,8 and 9 is allowed -->
5557
<maven.compiler.release>${java.target.version}</maven.compiler.release>
5658
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -133,6 +135,11 @@
133135
<build>
134136
<pluginManagement>
135137
<plugins>
138+
<plugin>
139+
<groupId>eu.maveniverse.maven.plugins</groupId>
140+
<artifactId>njord</artifactId>
141+
<version>${njord.version}</version>
142+
</plugin>
136143
<plugin>
137144
<artifactId>maven-surefire-plugin</artifactId>
138145
<version>3.3.1</version>
@@ -281,20 +288,6 @@
281288
<scmReleaseCommitComment>@{prefix} prepare release @{releaseLabel} [skip ci]</scmReleaseCommitComment>
282289
</configuration>
283290
</plugin>
284-
<plugin>
285-
<groupId>org.sonatype.plugins</groupId>
286-
<artifactId>nexus-staging-maven-plugin</artifactId>
287-
<extensions>true</extensions>
288-
<configuration>
289-
<serverId>ossrh</serverId>
290-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
291-
<!-- manually release in https://oss.sonatype.org/#stagingRepositories after the Maven release build -->
292-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
293-
<!-- workarounds to make releasing possible at times when ossrh is really slow -->
294-
<stagingProgressTimeoutMinutes>15</stagingProgressTimeoutMinutes>
295-
<keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
296-
</configuration>
297-
</plugin>
298291
<plugin>
299292
<groupId>com.diffplug.spotless</groupId>
300293
<artifactId>spotless-maven-plugin</artifactId>
@@ -337,6 +330,13 @@
337330
</executions>
338331
</plugin>
339332
</plugins>
333+
<extensions>
334+
<extension>
335+
<groupId>eu.maveniverse.maven.njord</groupId>
336+
<artifactId>extension3</artifactId>
337+
<version>${njord.version}</version>
338+
</extension>
339+
</extensions>
340340
</build>
341341

342342
<profiles>

0 commit comments

Comments
 (0)