Skip to content

Commit 0bcb417

Browse files
authored
JS-945 try to fix failing build (#5916)
1 parent 7deb5ab commit 0bcb417

1 file changed

Lines changed: 28 additions & 23 deletions

File tree

.github/workflows/build.yml

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,33 @@ jobs:
6464
echo "hash=$HASH" >> $GITHUB_OUTPUT
6565
echo "Computed NPM hash: $HASH"
6666
67+
config_maven:
68+
runs-on: github-ubuntu-latest-s
69+
name: Configure Maven
70+
needs: setup
71+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
72+
permissions: *read_permissions
73+
steps:
74+
- *checkout
75+
- &mise_java_maven
76+
name: Setup Java and Maven
77+
uses: jdx/mise-action@v3.4.0
78+
with:
79+
version: 2025.11.2
80+
mise_toml: |
81+
[tools]
82+
java = "17.0"
83+
maven = "3.9"
84+
- name: Configure Maven
85+
id: config-maven
86+
uses: SonarSource/ci-github-actions/config-maven@master
87+
with:
88+
artifactory-reader-role: private-reader
89+
6790
populate_maven_cache:
6891
runs-on: github-ubuntu-latest-m
6992
name: Populate Maven cache for Linux
70-
needs: setup
93+
needs: [setup, config_maven]
7194
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
7295
permissions: *read_permissions
7396
steps: &populate_maven_cache_steps
@@ -91,28 +114,10 @@ jobs:
91114
java = "17.0"
92115
maven = "3.9"
93116
- if: steps.cache.outputs.cache-hit != 'true'
94-
name: Access Artifactory credentials
95-
uses: SonarSource/vault-action-wrapper@v3
96-
id: secrets
117+
name: Configure Maven
118+
uses: SonarSource/ci-github-actions/config-maven@master
97119
with:
98-
secrets: |
99-
development/artifactory/token/${{ github.repository_owner }}-${{ github.event.repository.name }}-private-reader access_token | ARTIFACTORY_ACCESS_TOKEN;
100-
development/artifactory/token/${{ github.repository_owner }}-${{ github.event.repository.name }}-private-reader username | ARTIFACTORY_USERNAME;
101-
- if: steps.cache.outputs.cache-hit != 'true'
102-
name: Configure Maven settings
103-
run: |
104-
mkdir -p ~/.m2
105-
cat > ~/.m2/settings.xml <<EOF
106-
<settings>
107-
<servers>
108-
<server>
109-
<id>sonarsource</id>
110-
<username>${{ fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_USERNAME }}</username>
111-
<password>${{ fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_ACCESS_TOKEN }}</password>
112-
</server>
113-
</servers>
114-
</settings>
115-
EOF
120+
artifactory-reader-role: private-reader
116121
- if: steps.cache.outputs.cache-hit != 'true'
117122
name: Populate Maven dependencies
118123
run: |
@@ -122,7 +127,7 @@ jobs:
122127
populate_maven_cache_win:
123128
runs-on: github-windows-latest-s
124129
name: Populate Maven cache for Windows
125-
needs: setup
130+
needs: [setup, config_maven]
126131
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
127132
permissions: *read_permissions
128133
steps: *populate_maven_cache_steps

0 commit comments

Comments
 (0)