Skip to content

Commit 67bf879

Browse files
authored
ci: further factorize Maven arguments (#139)
Rely on the `MAVEN_ARGS` environment variable which is merged with the arguments defined at `.mvn/maven.config` level.
1 parent 9afdf5f commit 67bf879

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.github/scripts/publish_maven_artifacts.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ main() {
1818

1919
cd "${ROOT_REPOSITORY_DIR}"
2020

21-
$mvnw versions:set -DnewVersion="${NEW_VERSION}" --batch-mode -Dstyle.color=always
22-
$mvnw deploy -Prelease --batch-mode -Dstyle.color=always
21+
$mvnw versions:set -DnewVersion="${NEW_VERSION}"
22+
$mvnw deploy -Prelease
2323

2424
echo "The new version ${NEW_VERSION} has been published successfully!"
2525

2626
echo 'Putting back the DEV version...'
27-
$mvnw versions:set -DnewVersion="${DEV_VERSION}" --batch-mode -Dstyle.color=always
27+
$mvnw versions:set -DnewVersion="${DEV_VERSION}"
2828
}
2929

3030
main

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111

1212
permissions: {}
1313

14+
env:
15+
MAVEN_ARGS: --batch-mode -Dstyle.color=always
16+
1417
jobs:
1518
build-and-test:
1619
name: Build & Test
@@ -73,7 +76,7 @@ jobs:
7376
SONAR_ORGANIZATION="$(echo '${{ github.repository_owner }}' | awk '{print tolower($0)}')"
7477
SONAR_PROJECT_KEY="$(echo '${{ github.repository }}' | sed 's/\//_/')"
7578
76-
./mvnw verify sonar:sonar --batch-mode -Dstyle.color=always \
79+
./mvnw verify sonar:sonar \
7780
-Dsonar.host.url="${SONAR_HOST_URL}" \
7881
-Dsonar.organization="${SONAR_ORGANIZATION}" \
7982
-Dsonar.projectKey="${SONAR_PROJECT_KEY}"
@@ -122,7 +125,7 @@ jobs:
122125
languages: java
123126

124127
- name: Build
125-
run: ./mvnw package --batch-mode -Dstyle.color=always -DskipTests
128+
run: ./mvnw package -DskipTests
126129

127130
- name: Perform CodeQL Analysis
128131
uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0

.github/workflows/release.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,6 @@ jobs:
6969
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
7070
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}
7171
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
72+
MAVEN_ARGS: --batch-mode -Dstyle.color=always
7273
working-directory: .github/semantic-release/
7374
run: npx --no-install semantic-release

0 commit comments

Comments
 (0)