New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Build scan capture extension registration when using the Maven wrapper #37568
Conversation
@@ -42,7 +42,7 @@ concurrency: | |||
env: | |||
# Workaround testsuite locale issue | |||
LANG: en_US.UTF-8 | |||
COMMON_MAVEN_ARGS: "-e -B --settings .github/mvn-settings.xml --fail-at-end" | |||
COMMON_MAVEN_ARGS: "-e -B --settings .github/mvn-settings.xml --fail-at-end -Dmaven.ext.class.path=maven-build-scan-capture/lib/ext/maven-build-scan-capture-extension.jar" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot register the extension in the pom.xml
directly using a profile? That would maybe makes things easier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a core extension and according to the doc, the registration options are:
$MAVEN_HOME/lib/ext
extensions.xml
- CLI argument
-Dmaven.ext.class.path=extension.jar
This extension should not be added systematically, therefore the CLI argument solution
798ca68
to
8cd3cf6
Compare
8cd3cf6
to
66889f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@jprinet I was a bit too optimistic on this one and had to revert it because it looks as if
|
Oh wait, no, there's something very odd with this test... |
OK, so the test is adding an extension in the tree itself and then testing that the tree doesn't contain anything odd. I think the |
I changed the copy directory to |
Alright, you reverted the change, let me submit a new PR |
Issue
No Develocity Build scans are being published because the Maven extension to capture unpublished Build Scans is not registered.
When using the Maven wrapper, a Maven extension can't be registered once at the beginning of the build by copying it to
$MAVEN_HOME/lib/ext
as the folder is created on the firstmvnw
invocation (and emptied if already present).Fix
Install the Maven extension in
./maven-build-scan-capture/lib/ext
(using a relative path makes this approach compatible with Windows OS) and register the Maven extension as a Maven CLI argument (-Dmaven.ext.class.path
)