Skip to content

Commit 931465b

Browse files
authored
refactor: common maven goal wrappers (#820)
1 parent 14e50a0 commit 931465b

File tree

6 files changed

+25
-10
lines changed

6 files changed

+25
-10
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,9 @@ jobs:
214214
- name: untar build
215215
run: tar xzvf coatjava.tar.gz
216216
- name: print dependency tree
217-
run: mvn dependency:tree -Ddetail=true --no-transfer-progress
218-
- name: dependency analysis # note: skips `coat-libs`, since shaded JAR dependencies are "unused" according to `dependency:analyze`
219-
run: mvn dependency:analyze -DfailOnWarning=true -pl '!org.jlab.coat:coat-libs' --no-transfer-progress
217+
run: libexec/dependency-tree.sh
218+
- name: dependency analysis
219+
run: libexec/dependency-analysis.sh
220220

221221
# documentation
222222
#############################################################################
@@ -245,7 +245,7 @@ jobs:
245245
distribution: ${{ env.java_distribution }}
246246
- name: build coatjava javadocs # javadoc:aggregate output dir cannot be controlled, so assume the latest "standard" path and `mv` it
247247
run: |
248-
mvn javadoc:aggregate -pl '!org.jlab.coat:coat-libs' --no-transfer-progress
248+
libexec/build-javadocs.sh
249249
mv target/reports/apidocs pages/javadoc
250250
### upload artifacts
251251
- uses: actions/upload-pages-artifact@v4

.gitlab-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ depana:
3636
stage: test-stage
3737
dependencies: [build]
3838
script:
39-
- mvn dependency:tree -Ddetail=true --no-transfer-progress
40-
- mvn dependency:analyze -DfailOnWarning=true -pl '!org.jlab.coat:coat-libs' --no-transfer-progress
39+
- libexec/dependency-tree.sh
40+
- libexec/dependency-analysis.sh
4141

4242
eb:
4343
stage: test-stage
@@ -72,7 +72,7 @@ docs:
7272
script:
7373
- python3 -m pip install -r docs/mkdocs/requirements.txt
7474
- ./docs/mkdocs/generate.sh pages
75-
- mvn javadoc:aggregate -pl '!org.jlab.coat:coat-libs' --no-transfer-progress
75+
- libexec/build-javadocs.sh
7676
- mv target/reports/apidocs pages/javadoc
7777
- mv publish pages/jacoco
7878
artifacts:

build-coatjava.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,11 @@ if [ $cleanBuild == "yes" ]; then
145145
exit
146146
fi
147147

148+
# run dependency analysis and exit
148149
if [ $anaDepends == "yes" ]; then
149-
mvn dependency:analyze -DfailOnWarning=true -pl '!org.jlab.coat:coat-libs' --no-transfer-progress
150-
mvn dependency:tree -Ddetail=true --no-transfer-progress
151-
exit 0
150+
libexec/dependency-analysis.sh
151+
libexec/dependency-tree.sh
152+
exit 0
152153
fi
153154

154155
# start new installation tree

libexec/build-javadocs.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
# analyze maven dependencies
3+
# NOTE: skips `coat-libs`, the shaded JAR module
4+
set -euo pipefail
5+
mvn javadoc:aggregate -pl '!org.jlab.coat:coat-libs' --no-transfer-progress

libexec/dependency-analysis.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
# analyze maven dependencies
3+
# NOTE: skips `coat-libs`, since shaded JAR dependencies are "unused" according to `dependency:analyze`
4+
set -euo pipefail
5+
mvn dependency:analyze -DfailOnWarning=true -pl '!org.jlab.coat:coat-libs' --no-transfer-progress

libexec/dependency-tree.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
# print the maven dependency tree
3+
set -euo pipefail
4+
mvn dependency:tree -Ddetail=true --no-transfer-progress

0 commit comments

Comments
 (0)