Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
distribution: 'temurin'
java-version: ${{ matrix.jdk }}
# generate settings.xml with the correct values
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-id: sonatype-central-portal # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_PASSWORD # env variable for token in deploy

Expand All @@ -64,8 +64,8 @@ jobs:
if [ "${{ matrix.isMainBuildEnv }}" = "true" ]; then
echo "MVN_ADDITIONAL_OPTS=-Dsonar.projectKey=Netcentric_aem-cloud-validator -Dsonar.organization=netcentric -Dsonar.host.url=https://sonarcloud.io -Pjacoco-report -Dsonar.scanner.skipJreProvisioning=true" >> $GITHUB_ENV
if [ "${{github.ref}}" = "refs/heads/main" ] && [ "${{github.event_name}}" = "push" ]; then
echo "MAVEN_USERNAME=${{ secrets.OSSRH_TOKEN_USER }}" >> $GITHUB_ENV
echo "MAVEN_PASSWORD=${{ secrets.OSSRH_TOKEN_PASSWORD }}" >> $GITHUB_ENV
echo "MAVEN_USERNAME: ${{ secrets.SONATYPE_CENTRAL_TOKEN_USER }}" >> $GITHUB_ENV
echo "MAVEN_PASSWORD: ${{ secrets.SONATYPE_CENTRAL_TOKEN_PASSWORD }}" >> $GITHUB_ENV
echo "MVN_GOAL=clean deploy org.sonarsource.scanner.maven:sonar-maven-plugin:5.5.0.6356:sonar" >> $GITHUB_ENV
echo "STEP_NAME_SUFFIX=(Deploys to OSSRH)" >> $GITHUB_ENV
else
Expand Down
49 changes: 25 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
</scm>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<id>sonatype-central-portal</id>
<url>https://central.sonatype.com/repository/maven-snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<id>sonatype-central-portal</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</distributionManagement>

Expand All @@ -56,6 +56,14 @@
<maven.compiler.release>${java.target.version}</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<arguments /> <!-- additional arguments for the forked Maven run during releases -->
<njord.version>0.9.4</njord.version>
<!-- https://maveniverse.eu/docs/njord/configuration/#global-properties -->
<njord.autoPublish>true</njord.autoPublish>
<njord.publishingType>automatic</njord.publishingType>
<njord.waitForStates>true</njord.waitForStates>
<njord.publisher>sonatype-cp</njord.publisher>
<njord.releaseUrl>njord:template:release-sca</njord.releaseUrl>
<njord.snapshotUrl>njord:template:snapshot</njord.snapshotUrl>
</properties>

<dependencies>
Expand Down Expand Up @@ -125,6 +133,14 @@
</dependencies>

<build>
<extensions>
<!-- Njord extension for Maven, responsible for injecting the right repository -->
<extension>
<groupId>eu.maveniverse.maven.njord</groupId>
<artifactId>extension3</artifactId>
<version>${njord.version}</version>
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
Expand Down Expand Up @@ -184,11 +200,6 @@
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.8</version>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
Expand All @@ -203,6 +214,11 @@
<artifactId>maven-invoker-plugin</artifactId>
<version>3.9.1</version>
</plugin>
<plugin>
<groupId>eu.maveniverse.maven.plugins</groupId>
<artifactId>njord</artifactId>
<version>${njord.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand Down Expand Up @@ -281,21 +297,6 @@
<scmReleaseCommitComment>@{prefix} prepare release @{releaseLabel} [skip ci]</scmReleaseCommitComment>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<!-- manually release in https://oss.sonatype.org/#stagingRepositories after the Maven release build -->
<autoReleaseAfterClose>false</autoReleaseAfterClose>
<!-- workarounds to make releasing possible at times when ossrh is really slow -->
<stagingProgressTimeoutMinutes>15</stagingProgressTimeoutMinutes>
<keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
Expand Down