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

org.codehaus.mojo:properties-maven-plugin set-system-properties goal compatibility #879

Open
PayBas opened this issue Aug 22, 2023 · 3 comments

Comments

@PayBas
Copy link

PayBas commented Aug 22, 2023

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.

@ppalaga
Copy link
Contributor

ppalaga commented Aug 28, 2023

Does this happen also with a freshly started daemon? - i.e. after mvnd --stop?

@PayBas
Copy link
Author

PayBas commented Aug 29, 2023

@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

@PayBas
Copy link
Author

PayBas commented Mar 18, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants