Skip to content

Commit 0b5f109

Browse files
committed
deploy with Njord to Central Portal
1 parent 3e45bc9 commit 0b5f109

File tree

2 files changed

+32
-23
lines changed

2 files changed

+32
-23
lines changed

.github/workflows/maven.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: Java CI/CD
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [opened, synchronize, reopened]
49

510
jobs:
611
build:
@@ -14,7 +19,8 @@ jobs:
1419
with:
1520
distribution: 'temurin'
1621
java-version: 21
17-
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
22+
# generate settings.xml with the correct values
23+
server-id: sonatype-central-portal # Value of the distributionManagement/repository/id field of the pom.xml
1824
server-username: MAVEN_USERNAME # env variable for username in deploy
1925
server-password: MAVEN_PASSWORD # env variable for token in deploy
2026
- name: Adjust Git Config
@@ -23,7 +29,7 @@ jobs:
2329
git config --global user.name "GitHub Action"
2430
- name: Build and Analyse Reactor with Maven
2531
if: github.ref != 'refs/heads/master'
26-
run: ./mvnw -B clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=Netcentric_aem-classification -Dsonar.organization=netcentric -Dsonar.host.url=https://sonarcloud.io -Pcoverage-report
32+
run: ./mvnw -B clean install org.sonarsource.scanner.maven:sonar-maven-plugin:5.2.0.4988:sonar -Dsonar.projectKey=Netcentric_aem-classification -Dsonar.organization=netcentric -Dsonar.host.url=https://sonarcloud.io -Dsonar.scanner.skipJreProvisioning=true -Pcoverage-report
2733
env:
2834
# SonarCloud access token should be generated from https://sonarcloud.io/account/security/
2935
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
@@ -34,10 +40,10 @@ jobs:
3440
run: ./mvnw -B clean site --file aem-classification-maven-plugin/pom.xml
3541
- name: Build, Analyse and Deploy Reactor with Maven
3642
if: github.ref == 'refs/heads/master'
37-
run: ./mvnw -B clean deploy org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=Netcentric_aem-classification -Dsonar.organization=netcentric -Dsonar.host.url=https://sonarcloud.io -Pcoverage-report
43+
run: ./mvnw -B clean deploy org.sonarsource.scanner.maven:sonar-maven-plugin:5.2.0.4988:sonar -Dsonar.projectKey=Netcentric_aem-classification -Dsonar.organization=netcentric -Dsonar.host.url=https://sonarcloud.io -Dsonar.scanner.skipJreProvisioning=true -Pcoverage-report -DaltDeploymentRepository=id::njord:snapshot
3844
env:
39-
MAVEN_USERNAME: ${{ secrets.OSSRH_TOKEN_USER }}
40-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN_PASSWORD }}
45+
MAVEN_USERNAME: ${{ secrets.SONATYPE_CENTRAL_TOKEN_USER }}
46+
MAVEN_PASSWORD: ${{ secrets.SONATYPE_CENTRAL_TOKEN_PASSWORD }}
4147
# SonarCloud access token should be generated from https://sonarcloud.io/account/security/
4248
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4349
# Needed to get some information about the pull request, if any

pom.xml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,23 @@
4242

4343
<distributionManagement>
4444
<snapshotRepository>
45-
<id>ossrh</id>
46-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
45+
<id>sonatype-central-portal</id>
46+
<name>AEM Classification Snapshots</name>
47+
<url>https://central.sonatype.com/repository/maven-snapshots</url>
4748
</snapshotRepository>
4849
<repository>
49-
<id>ossrh</id>
50-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
50+
<id>sonatype-central-portal</id>
51+
<name>AEM Classification Releases</name>
52+
<url>https://repo.maven.apache.org/maven2</url>
5153
</repository>
5254
</distributionManagement>
5355

5456
<properties>
55-
<maven.version>3.3.9</maven.version>
57+
<maven.version>3.9</maven.version>
5658
<maven.compiler.release>8</maven.compiler.release> <!-- used for compiler and javadoc plugin -->
5759
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5860
<junit.jupiter.version>5.9.0</junit.jupiter.version>
61+
<njord.version>0.8.3</njord.version>
5962
</properties>
6063

6164
<dependencyManagement>
@@ -76,8 +79,20 @@
7679
</dependencyManagement>
7780

7881
<build>
82+
<extensions>
83+
<extension>
84+
<groupId>eu.maveniverse.maven.njord</groupId>
85+
<artifactId>extension3</artifactId>
86+
<version>${njord.version}</version>
87+
</extension>
88+
</extensions>
7989
<pluginManagement>
8090
<plugins>
91+
<plugin>
92+
<groupId>eu.maveniverse.maven.plugins</groupId>
93+
<artifactId>njord</artifactId>
94+
<version>${njord.version}</version>
95+
</plugin>
8196
<plugin>
8297
<artifactId>maven-surefire-plugin</artifactId>
8398
<version>3.5.1</version>
@@ -254,18 +269,6 @@
254269
<scmReleaseCommitComment>@{prefix} prepare release @{releaseLabel} [skip ci]</scmReleaseCommitComment>
255270
</configuration>
256271
</plugin>
257-
<plugin>
258-
<groupId>org.sonatype.plugins</groupId>
259-
<artifactId>nexus-staging-maven-plugin</artifactId>
260-
<extensions>true</extensions>
261-
<configuration>
262-
<serverId>ossrh</serverId>
263-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
264-
<!-- manually release in https://oss.sonatype.org/#stagingRepositories after the Maven release build -->
265-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
266-
</configuration>
267-
</plugin>
268-
269272
<plugin>
270273
<groupId>org.codehaus.mojo</groupId>
271274
<artifactId>license-maven-plugin</artifactId>

0 commit comments

Comments
 (0)