Publish Maven artifacts in GitHub Actions workflow
@@ -17,6 +17,9 @@ jobs:
with:
java-version: '11'
distribution: 'temurin'
+ server-id: oss.sonatype.org
+ server-username: MAVEN_USERNAME
+ server-password: MAVEN_PASSWORD
- name: Cache local Maven repository
uses: actions/cache@v2
with:
@@ -24,5 +27,8 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- - name: Build with Maven
- run: ./mvnw -B package
+ - name: Publish with Maven
+ run: ./mvnw -B deploy -Ddeployment
+ env:
+ MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
+ MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
