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