Skip to content

Commit 4d74c1d

Browse files
committed
create custom mvn setting for CI script
Signed-off-by: Mohamed Sylla <[email protected]>
1 parent 0e8cec0 commit 4d74c1d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/sonarcloud-analysis.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,18 @@ jobs:
3030
path: ~/.m2
3131
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
3232
restore-keys: ${{ runner.os }}-m2
33+
- name: Create custom Maven Settings.xml
34+
uses: whelk-io/maven-settings-xml-action@v18
35+
with:
36+
output_file: custom_maven_settings.xml
37+
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
3338
- name: Build and analyze
3439
env:
3540
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3641
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
37-
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=com-pas_compas-sct -Dsonar.organization=com-pas -Dsonar.host.url=https://sonarcloud.io
42+
run: |
43+
./mvnw -B -s custom_maven_settings.xml \
44+
-Dsonar.projectKey=com-pas_compas-sct \
45+
-Dsonar.organization=com-pas \
46+
-Dsonar.host.url=https://sonarcloud.io \
47+
verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar

0 commit comments

Comments
 (0)