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

Tone down Maven plugin output #12

Merged
merged 5 commits into from
Oct 7, 2024

Conversation

gnodet
Copy link
Contributor

@gnodet gnodet commented Sep 30, 2024

The current output for a project that uses this Maven extension is the following (when running with Maven 3.x):

➜  camel git:(cleanup-dep-mgmt) ~/.sdkman/candidates/maven/3.9.8/bin/mvn foo     
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: osx
[INFO] os.detected.arch: aarch_64
[INFO] os.detected.bitness: 64
[INFO] os.detected.version: 14.6
[INFO] os.detected.version.major: 14
[INFO] os.detected.version.minor: 6
[INFO] os.detected.classifier: osx-aarch_64
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: osx
[INFO] os.detected.arch: aarch_64
[INFO] os.detected.bitness: 64
[INFO] os.detected.version: 14.6
[INFO] os.detected.version.major: 14
[INFO] os.detected.version.minor: 6
[INFO] os.detected.classifier: osx-aarch_64
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] Camel                                                              [pom]
[INFO] Camel :: Buildtools                                                [jar]
[INFO] Camel :: Parent                                                    [pom]

This is really verbose (and duplicate), so I'd suggest to just move all the log to debug in Maven.

Copy link
Owner

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this change, what's the output?

The output you attached seems have some duplicate. Not sure this patch keep one output or filter out all.

@gnodet
Copy link
Contributor Author

gnodet commented Sep 30, 2024

After this change, what's the output?

The output you attached seems have some duplicate. Not sure this patch keep one output or filter out all.

The duplicate run is kind expected. At least it was this way in the original plugin. The session is injected at the very beginning, and then after projects are read to allow injecting into projects.
With the PR, nothing should be logged at all at INFO level, but everything will be moved to DEBUG.
What we could do is just add a single INFO output so that we can easily check that the maven plugin is actually in use and doing it's work.

@gnodet
Copy link
Contributor Author

gnodet commented Sep 30, 2024

I pushed some changes. The output is the following:

➜  camel git:(cleanup-dep-mgmt) ~/.sdkman/candidates/maven/3.9.8/bin/mvn foo -N                                          
[INFO] The os-detector Maven 3 extension is registered, OS and CPU architecture properties will be provided.
[INFO] Scanning for projects...
[INFO] 
...
➜  camel git:(cleanup-dep-mgmt) ~/.sdkman/candidates/maven/3.9.8/bin/mvn foo -N -X
Apache Maven 3.9.8 (36645f6c9b5079805ea5009217e36f2cffd34256)
Maven home: /Users/gnodet/.sdkman/candidates/maven/3.9.8
Java version: 21.0.4, vendor: Eclipse Adoptium, runtime: /Users/gnodet/.sdkman/candidates/java/21.0.4-tem
Default locale: en_FR, platform encoding: UTF-8
OS name: "mac os x", version: "14.6.1", arch: "aarch64", family: "Mac"
... <ommitted debug output from maven>...
[INFO] The os-detector Maden 3 extension is registered, OS and CPU architecture properties will be provided.
[DEBUG] ------------------------------------------------------------------------
[DEBUG] Detecting the operating system and CPU architecture
[DEBUG] ------------------------------------------------------------------------
[DEBUG] os.detected.name: osx
[DEBUG] os.detected.arch: aarch_64
[DEBUG] os.detected.bitness: 64
[DEBUG] os.detected.version: 14.6
[DEBUG] os.detected.version.major: 14
[DEBUG] os.detected.version.minor: 6
[DEBUG] os.detected.classifier: osx-aarch_64
[INFO] Scanning for projects...
... <ommitted debug output from maven>...
[DEBUG] ------------------------------------------------------------------------
[DEBUG] Detecting the operating system and CPU architecture
[DEBUG] ------------------------------------------------------------------------
[DEBUG] os.detected.name: osx
[DEBUG] os.detected.arch: aarch_64
[DEBUG] os.detected.bitness: 64
[DEBUG] os.detected.version: 14.6
[DEBUG] os.detected.version.major: 14
[DEBUG] os.detected.version.minor: 6
[DEBUG] os.detected.classifier: osx-aarch_64
...
➜  camel git:(cleanup-dep-mgmt) ~/work/git/maven/apache-maven/target/apache-maven-4.0.0-beta-5-SNAPSHOT/bin/mvn foo -N -X
[INFO] The os-detector Maven 4 extension is registered, OS and CPU architecture properties will be provided.
[INFO] Scanning for projects...
...
➜  camel git:(cleanup-dep-mgmt) ~/work/git/maven/apache-maven/target/apache-maven-4.0.0-beta-5-SNAPSHOT/bin/mvn foo -N -X
Apache Maven 4.0.0-beta-5-SNAPSHOT (3b151c0d3c881b83058e55838a3a50b1588d8e78)
Maven home: /Users/gnodet/work/git/maven/apache-maven/target/apache-maven-4.0.0-beta-5-SNAPSHOT
Java version: 21.0.4, vendor: Eclipse Adoptium, runtime: /Users/gnodet/.sdkman/candidates/java/21.0.4-tem
Default locale: en_FR, platform encoding: UTF-8
OS name: "mac os x", version: "14.6.1", arch: "aarch64", family: "mac"
... <ommitted debug output from maven>...
[INFO] The os-detector Maven 4 extension is registered, OS and CPU architecture properties will be provided.
[DEBUG] ------------------------------------------------------------------------
[DEBUG] Detecting the operating system and CPU architecture
[DEBUG] ------------------------------------------------------------------------
[DEBUG] os.detected.name: osx
[DEBUG] os.detected.arch: aarch_64
[DEBUG] os.detected.bitness: 64
[DEBUG] os.detected.version: 14.6
[DEBUG] os.detected.version.major: 14
[DEBUG] os.detected.version.minor: 6
[DEBUG] os.detected.classifier: osx-aarch_64
[INFO] Scanning for projects...
...

@gnodet
Copy link
Contributor Author

gnodet commented Sep 30, 2024

Please give me some time before releasing, the above change made me realise the extension was working on Maven master, but not on 4.0.0-beta-4, so I'd like to provide a fix before next release.

Copy link
Owner

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Let me know if this is good to merge.

You can change PR to draft if you find any other blocker.

And I'd appreciate it if you can link the related Maven PR you mentioned above.

@gnodet
Copy link
Contributor Author

gnodet commented Oct 7, 2024

Thanks. Let me know if this is good to merge.

You can change PR to draft if you find any other blocker.

And I'd appreciate it if you can link the related Maven PR you mentioned above.

Feel free to merge and release. I cannot find a way to make it work on Maven 4.0.0-beta-4, so it'll require coming beta-5 anyway...

@tisonkun tisonkun merged commit 0744c60 into tisonkun:main Oct 7, 2024
3 checks passed
@tisonkun
Copy link
Owner

tisonkun commented Oct 7, 2024

Thank you!

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

Successfully merging this pull request may close these issues.

2 participants