Skip to content

Commit e0bb3f5

Browse files
authored
add actions/setup-java to generate settings.xml
1 parent 3e720ef commit e0bb3f5

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

troubleshooting/codeql-builds/compiled-languages-java.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,20 @@ ex `settings.xml`
2424
</server>
2525
```
2626

27-
Option 2 - Use the [maven-settings-action](https://github.com/s4u/maven-settings-action) to dynamically create/overrite a `settings.xml` that contains the credentials for your specified package manager.
27+
Option 2 - Use the GitHub https://github.com/actions/setup-java#maven-options action to generate maven's settings.xml on the fly and pass the values to Apache Maven GPG Plugin as well as Apache Maven Toolchains.
28+
29+
```yml
30+
- name: Set up Apache Maven Central
31+
uses: actions/setup-java@v3
32+
with:
33+
distribution: 'temurin'
34+
java-version: '11'
35+
server-id: maven # Value of the distributionManagement/repository/id field of the pom.xml
36+
server-username: MAVEN_USERNAME # env variable for username in deploy
37+
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
38+
```
39+
40+
Option 3 - Use the [maven-settings-action](https://github.com/s4u/maven-settings-action) to dynamically create/overrite a `settings.xml` that contains the credentials for your specified package manager.
2841

2942
```yml
3043
- if: matrix.language == 'java'

0 commit comments

Comments
 (0)