Skip to content

Commit a04afaa

Browse files
committed
ci: switch distribution to Temurin and fix Maven Central setup logic
- Updated GitHub workflow to use the 'temurin' distribution instead of 'adopt'. - Added a second `setup-java` step to ensure Maven Central settings are correctly configured after the initial setup.
1 parent 9356058 commit a04afaa

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/maven-snapshot.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: actions/setup-java@v4
1717
with:
1818
java-version: ${{ matrix.java }}
19-
distribution: 'adopt'
19+
distribution: 'temurin'
2020
server-id: central
2121
server-username: MAVEN_USERNAME
2222
server-password: MAVEN_PASSWORD
@@ -28,6 +28,16 @@ jobs:
2828
restore-keys: ${{ runner.os }}-m2
2929
- name: Build, test, verify and publish snapshot
3030
run: mvn -B verify -Djdk.version=${{ matrix.java }}
31+
32+
# Running setup-java again overwrites the settings.xml - IT'S MANDATORY TO DO THIS SECOND SETUP!!!
33+
- name: Set up Maven Central Repository
34+
uses: actions/setup-java@v4
35+
with:
36+
java-version: ${{ env.JAVA_VERSION }}
37+
distribution: 'temurin'
38+
server-id: central
39+
server-username: MAVEN_USERNAME
40+
server-password: MAVEN_PASSWORD
3141
- name: Publish snapshot
3242
if: ${{ matrix.java == '17' }}
3343
run: mvn deploy -pl '!report,!xoai-data-provider-tck' -DskipUT -DskipIT -Djdk.version=${{ matrix.java }}

0 commit comments

Comments
 (0)