Skip to content
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

classworlds-freestyle.conf not loading ${maven.conf}/logging #930

Open
sunruh opened this issue Mar 19, 2024 · 0 comments
Open

classworlds-freestyle.conf not loading ${maven.conf}/logging #930

sunruh opened this issue Mar 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@sunruh
Copy link

sunruh commented Mar 19, 2024

Describe the bug
When Maven is run with artifactory integration enabled, Maven's default logging configuration is not used as the classworlds configuration does not add ${maven.conf}/logging to the classpath.

This breaks plugins lige warnings-ng which expect Maven's default logging configuration for parsing the output.

To Reproduce
Call rtMaven.run() with artifactory integration enabled. Log output will be the following:

Jenkins Artifactory Plugin version: 4.0.3
Artifactory integration is enabled
Executing command: /bin/sh -c git log --pretty=format:%s -1
[...] $ /usr/java/default/bin/java ... -Dclassworlds.conf=...@tmp/artifactory/classworlds17487772053293298460conf ...
...
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Scanning for projects...
  • Thread name is included
  • Log level has no brackets
  • Log name is included

Expected behavior
Logging output is the same as if maven is run with it's default classworld configuration:

+ mvn ...
[INFO] Scanning for projects...

Versions

  • Jenkins Artifactory plugin version: 4.0.3
  • Jenkins operating system: Linux
  • Artifactory Version: N/A

Additional context
Maven configures the SLF4J simple logger through the properties file ${maven.conf}/logging/simplelogger.properties. For this to work, ${maven.conf}/logging has to be on the classpath, which is accomplished by configuring the plexus launcher in ${maven.home}/bin/m2.conf.

Workaround is to supply system properties resembling Maven's logging setup: -Dorg.slf4j.simpleLogger.levelInBrackets=true -Dorg.slf4j.simpleLogger.showLogName=false -Dorg.slf4j.simpleLogger.showThreadName=false

Can be fixed bei adding either load ${maven.conf}/logging or optionally ${maven.conf}/logging to classworlds-freestyle.conf.

@sunruh sunruh added the bug Something isn't working label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant