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
18 changes: 12 additions & 6 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Java CI/CD

on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:
Expand All @@ -14,7 +19,8 @@ jobs:
with:
distribution: 'temurin'
java-version: 21
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
# generate settings.xml with the correct values
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
- name: Adjust Git Config
Expand All @@ -23,7 +29,7 @@ jobs:
git config --global user.name "GitHub Action"
- name: Build and Analyse Reactor with Maven
if: github.ref != 'refs/heads/master'
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
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
env:
# SonarCloud access token should be generated from https://sonarcloud.io/account/security/
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand All @@ -34,10 +40,10 @@ jobs:
run: ./mvnw -B clean site --file aem-classification-maven-plugin/pom.xml
- name: Build, Analyse and Deploy Reactor with Maven
if: github.ref == 'refs/heads/master'
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
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
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_TOKEN_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.SONATYPE_CENTRAL_TOKEN_USER }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_CENTRAL_TOKEN_PASSWORD }}
# SonarCloud access token should be generated from https://sonarcloud.io/account/security/
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# Needed to get some information about the pull request, if any
Expand Down
37 changes: 20 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,23 @@

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<id>sonatype-central-portal</id>
<name>AEM Classification Snapshots</name>
<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>
<name>AEM Classification Releases</name>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</distributionManagement>

<properties>
<maven.version>3.3.9</maven.version>
<maven.version>3.9</maven.version>
<maven.compiler.release>8</maven.compiler.release> <!-- used for compiler and javadoc plugin -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.jupiter.version>5.9.0</junit.jupiter.version>
<njord.version>0.8.3</njord.version>
</properties>

<dependencyManagement>
Expand All @@ -76,8 +79,20 @@
</dependencyManagement>

<build>
<extensions>
<extension>
<groupId>eu.maveniverse.maven.njord</groupId>
<artifactId>extension3</artifactId>
<version>${njord.version}</version>
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
<groupId>eu.maveniverse.maven.plugins</groupId>
<artifactId>njord</artifactId>
<version>${njord.version}</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.1</version>
Expand Down Expand Up @@ -254,18 +269,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>
</configuration>
</plugin>

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