maven-mvnd
maven-mvnd copied to clipboard
org.codehaus.mojo:properties-maven-plugin `set-system-properties` goal compatibility
http://www.mojohaus.org/properties-maven-plugin/usage.html has a goal called set-system-properties which can be used to set (you guessed it) system properties (as opposed to Maven properties) for specific Maven projects.
I use it to silence some particularly spammy Maven plugins which don't offer built-in verbosity options:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>set-system-properties</goal>
</goals>
<configuration>
<properties>
<property>
<name>org.slf4j.simpleLogger.log.io.swagger.codegen.v3.AbstractGenerator</name>
<value>warn</value>
</property>
<property>
<name>org.slf4j.simpleLogger.log.io.swagger.codegen.v3.generators.DefaultCodegenConfig</name>
<value>error</value>
</property>
</properties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
This works perfectly well with mvn, but doesn't work with mvnd
If I run a build with the -Dorg.slf4j.simpleLogger.showLogName parameter, I can see that it's still the same log-producers.
So either the system properties aren't applied, or the way mvnd collects the logs results in strange behavior.
http://www.mojohaus.org/properties-maven-plugin/set-system-properties-mojo.html explicitly mentions:
The goal is thread-safe and supports parallel builds.
So I'm guessing this is a mvnd issue.
Does this happen also with a freshly started daemon? - i.e. after mvnd --stop?
@ppalaga indeed when I run:
mvnd --stop
mvnd clean install -pl :the-offending-module
It works properly.
If I subsequently run:
mvnd clean install -pl :the-offending-module
The spamming starts again.
Curious
I resorted to just including the following in my project's .mvn/maven.config:
-Dorg.slf4j.simpleLogger.log.io.swagger.codegen.v3.AbstractGenerator=warn
-Dorg.slf4j.simpleLogger.log.io.swagger.codegen.v3.generators.DefaultCodegenConfig=error
Because this issue was driving me insane.