Skip to content

Commit bdbd5aa

Browse files
committed
build(versions): replace IGNORED_VERSIONS with MAVEN_CLI_EXTRA_OPTS
1 parent 0182576 commit bdbd5aa

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
- name: Check the versions
6666
uses: docker://leplusorg/maven-check-versions:3.9.9@sha256:abdd53328be1c87d7bf21b868d47d7934b28dfc66e168d9625877616ab14d6da
6767
env:
68-
MAVEN_CLI_OPTS: "-DprocessDependencyManagementTransitive=false '-Dmaven.version.ignore=(?i).+-(alpha|beta).+,(?i).+-m\\d+,(?i).+-rc\\d+'"
68+
MAVEN_CLI_EXTRA_OPTS: "-DprocessDependencyManagementTransitive=false '-Dmaven.version.ignore=(?i).+-(alpha|beta).+,(?i).+-m\\d+,(?i).+-rc\\d+'"
6969
```
7070
7171
This way the action can be triggered manually and otherwise it runs
@@ -82,7 +82,7 @@ maven check versions:
8282
script:
8383
- "/opt/maven-check-versions.sh"
8484
variables:
85-
MAVEN_CLI_OPTS: "-DprocessDependencyManagementTransitive=false '-Dmaven.version.ignore=(?i).+-(alpha|beta).+,(?i).+-m\\d+,(?i).+-rc\\d+'"
85+
MAVEN_CLI_EXTRA_OPTS: "-DprocessDependencyManagementTransitive=false '-Dmaven.version.ignore=(?i).+-(alpha|beta).+,(?i).+-m\\d+,(?i).+-rc\\d+'"
8686
```
8787
8888
## Ignoring versions
@@ -91,9 +91,9 @@ You can define which versions should be ignored using the
9191
`maven.version.ignore` system property (see here for
9292
[details](https://www.mojohaus.org/versions/versions-maven-plugin/version-rules.html#Using_the_maven.version.ignore_property)). To
9393
set `maven.version.ignore` inside the Docker container, you need to
94-
override the default `MAVEN_CLI_OPTS` OS environment variable which
94+
override the default `MAVEN_CLI_EXTRA_OPTS` OS environment variable which
9595
will be passed to the maven CLI command. For example, you can set
96-
`MAVEN_CLI_OPTS` to `-DprocessDependencyManagementTransitive=false -Dmaven.version.ignore=(?i).+-(alpha|beta).+,(?i).+-m\\d+,(?i).+-rc\\d+`
96+
`MAVEN_CLI_EXTRA_OPTS` to `-DprocessDependencyManagementTransitive=false -Dmaven.version.ignore=(?i).+-(alpha|beta).+,(?i).+-m\\d+,(?i).+-rc\\d+`
9797
to ignore transitive dependencies and all alpha, beta, mark or release
9898
candidate versions.
9999

maven-check-versions/maven-check-versions.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,25 @@ else
5858
cmd=$(\which mvn)
5959
fi
6060

61+
if [ -z "${MAVEN_OPTS+x}" ]; then
62+
MAVEN_OPTS=-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true
63+
fi
64+
6165
if [ -z "${MAVEN_CLI_OPTS+x}" ]; then
62-
opts=('-DprocessDependencyManagementTransitive=false')
66+
opts=(--batch-mode --errors --fail-at-end --show-version)
6367
else
6468
IFS=' ' read -r -a opts <<<"${MAVEN_CLI_OPTS}"
6569
fi
6670

71+
if [ -z "${MAVEN_CLI_EXTRA_OPTS+x}" ]; then
72+
extra_opts=(-DprocessDependencyManagementTransitive=false)
73+
else
74+
IFS=' ' read -r -a extra_opts <<<"${MAVEN_CLI_EXTRA_OPTS}"
75+
fi
76+
6777
rc=0
6878

69-
"${cmd}" "${opts[@]+"${opts[@]}"}" \
79+
"${cmd}" "${opts[@]}" "${extra_opts[@]}" \
7080
versions:display-dependency-updates \
7181
versions:display-plugin-updates \
7282
versions:display-property-updates |

0 commit comments

Comments
 (0)