jfrog / jenkins-artifactory-plugin

Jenkins artifactory plugin
http://jenkins-ci.org/
116 stars 190 forks source link

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

Open sunruh opened 8 months ago

sunruh commented 8 months ago

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...

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

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

Versions

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.