Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/maven-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
fi
# pinned, mycore-parent does not manage it and Dependabot does not see it.
# Maven writes its errors to stdout, they are printed if it fails
VERSION="$(mvn --batch-mode --no-transfer-progress -q -N \
VERSION="$(mvn --batch-mode --no-transfer-progress --update-snapshots -q -N \
org.apache.maven.plugins:maven-help-plugin:3.5.2:evaluate -Dexpression=project.version -DforceStdout)" \
|| { echo "$VERSION"; exit 1; }
case "$VERSION" in
Expand All @@ -111,8 +111,8 @@ jobs:
# with the arguments of the build, whose profiles may add modules. Split at spaces and line breaks, so a
# YAML block keeps all its arguments
read -r -d '' -a ARGS <<< "$BUILD_ARGS" || true
mvn --batch-mode --no-transfer-progress versions:set -DnewVersion="$QUALIFIED" -DgenerateBackupPoms=false \
"${ARGS[@]}"
mvn --batch-mode --no-transfer-progress --update-snapshots versions:set -DnewVersion="$QUALIFIED" \
-DgenerateBackupPoms=false "${ARGS[@]}"
echo "Deploying ${QUALIFIED}"

# deploy-to-central of mycore-parent stages the snapshots, -DskipUpload=true keeps them in deferredDirectory
Expand All @@ -128,7 +128,7 @@ jobs:
set -euo pipefail
# pinned, mycore-parent does not manage it and Dependabot does not see it.
# Maven writes its errors to stdout, they are printed if it fails
VERSION="$(mvn --batch-mode --no-transfer-progress -q -N \
VERSION="$(mvn --batch-mode --no-transfer-progress --update-snapshots -q -N \
org.apache.maven.plugins:maven-help-plugin:3.5.2:evaluate -Dexpression=project.version -DforceStdout)" \
|| { echo "$VERSION"; exit 1; }
# for a release the plugin would build a bundle for Central, which nothing uploads
Expand All @@ -141,7 +141,7 @@ jobs:
esac
# deploy uploads with the maven-deploy-plugin the parent manages and checks the version again,
# this only fails before the build
DEPLOY_PLUGIN="$(mvn --batch-mode --no-transfer-progress -q -N \
DEPLOY_PLUGIN="$(mvn --batch-mode --no-transfer-progress --update-snapshots -q -N \
org.apache.maven.plugins:maven-help-plugin:3.5.2:evaluate -Dexpression=maven-deploy-plugin.version \
-DforceStdout || true)"
if [[ ! "$DEPLOY_PLUGIN" =~ ^3\.[1-9][0-9]*\.[0-9]+$ ]]; then
Expand All @@ -157,7 +157,8 @@ jobs:
# maven-deploy-plugin, into STRAY instead of a repository of its own. The plugin takes the release and
# snapshot variants of altDeploymentRepository first, so all three are set
STRAY="${RUNNER_TEMP}/stray-deploy"
mvn --batch-mode --no-transfer-progress deploy ${SKIP_TESTS_FLAG:+"$SKIP_TESTS_FLAG"} "${ARGS[@]}" \
mvn --batch-mode --no-transfer-progress --update-snapshots deploy ${SKIP_TESTS_FLAG:+"$SKIP_TESTS_FLAG"} \
"${ARGS[@]}" \
"-Dcentral-publishing-maven-plugin.version=${CENTRAL_PUBLISHING_VERSION}" -DskipUpload=true \
"-DdeferredDirectory=${STAGING}" "-DaltDeploymentRepository=stray::file://${STRAY}" \
"-DaltReleaseDeploymentRepository=stray::file://${STRAY}" \
Expand Down
3 changes: 3 additions & 0 deletions docs/maven-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ with a secret:
`maven-deploy-plugin`; `-DaltDeploymentRepository` and its release and snapshot variants send that into a
directory of its own, and anything there fails the run. `build-args` cannot change where the snapshots go, only
deploy uploads them. `versions:set` gets `build-args` as well.
- The checks, `versions:set` and the build run with `--update-snapshots`, so they get the newest snapshots of the
parent and the dependencies, e.g. of `mycore` after a [dispatch](dispatch-downstream.md). Without it, Maven
checks a snapshot once a day, and the restored Maven cache can hold one checked less than a day ago.
- With `docker-images`, it builds the images and saves them for the job `images`.
2. **deploy** checks out the commit again, but only reads its poms, with
[`snapshot-upload`](../.github/actions/snapshot-upload/action.yml).
Expand Down