davsclaus commented on code in PR #27826:
URL: https://github.com/apache/camel/pull/27826#discussion_r4275135765
##########
.github/workflows/package-native-validation.yml:
##########
@@ -81,14 +83,24 @@ jobs:
java-version: '21'
cache: 'maven'
+ # Packaging scripts invoke mvn themselves, so pin their PATH entry as
well as
+ # the direct workflow commands. Keep the snapshot profile active in
subprocesses.
+ - name: Pin Maven for packaging subprocesses
+ shell: bash
+ run: |
+ CAMEL_CI_MAVEN_HOME=$(./mvnw -q -B -P apache-snapshots -ntp -N
org.apache.maven.plugins:maven-help-plugin:3.5.1:evaluate \
+ -Dexpression=maven.home -DforceStdout)
+ echo "$CAMEL_CI_MAVEN_HOME/bin" >> "$GITHUB_PATH"
Review Comment:
Optional: fail the step if `maven.home` did not come out as a Maven install,
so the packaging scripts never silently fall back to the runner's `mvn`:
```suggestion
test -x "$CAMEL_CI_MAVEN_HOME/bin/mvn" || { echo "Unexpected
maven.home: $CAMEL_CI_MAVEN_HOME" >&2; exit 1; }
echo "$CAMEL_CI_MAVEN_HOME/bin" >> "$GITHUB_PATH"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]