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

using aggregate-add-third-party is not working when packaging is pom even I have set acceptPomPackaging as true #586

Open
ma345564280 opened this issue Sep 6, 2024 · 5 comments

Comments

@ma345564280
Copy link

I have set acceptPomPackaging as true, but still got the following message.

[INFO] --- license:2.4.0:aggregate-add-third-party (default-cli) @ xxxxxx ---
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
[INFO] The goal is skip due to packaging 'jar'
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.812 s
[INFO] Finished at: 2024-09-06T17:27:40+08:00
[INFO] ------------------------------------------------------------------------

@ma345564280
Copy link
Author

add-third-party is working

@slawekjaranowski
Copy link
Member

There is a method org.codehaus.mojo.license.AbstractLicenseMojo#checkPackaging
It is override by:

  • org.codehaus.mojo.license.AddThirdPartyMojo#checkPackaging
  • org.codehaus.mojo.license.AggregatorAddThirdPartyMojo#checkPackaging

Fixing and write tests for it should not be difficult.

@vitalijr2
Copy link
Contributor

I have multi-module project, parent is "pom" and children are "jar".

I run ./mvnw license:aggregate-add-third-party, the log is:

[INFO] 
[INFO] --- license:2.4.0:aggregate-add-third-party (default-cli) @ some-project ---
[INFO] The default plugin hint is: org.codehaus.mojo:license-maven-plugin:2.4.0:add-third-party
[INFO] Detected 3 license(s).
[INFO] Writing third-party file to some-project/THIRD-PARTY.txt
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Some Project 1.0.0:
[INFO] 
[INFO] Some Project ....................................... SUCCESS [  0.876 s]
[INFO] First child .................. SKIPPED
[INFO] Second child ............ SKIPPED
[INFO] Third child .............. SKIPPED
[INFO] Fourth child ............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

The file THIRD-PARTY.txt look like:


Lists of 16 third-party dependencies.
     (Apache License version 2.0) Apache Commons Logging (commons-logging:commons-logging:1.3.4 - https://commons.apache.org/proper/commons-logging/)
...
     (Eclipse Public License - v 2.0) JUnit Jupiter API (org.junit.jupiter:junit-jupiter-api:5.11.3 - https://junit.org/junit5/)
     (Eclipse Public License - v 2.0) JUnit Jupiter Engine (org.junit.jupiter:junit-jupiter-engine:5.11.3 - https://junit.org/junit5/)
...
     (MIT License) SLF4J API Module (org.slf4j:slf4j-api:2.0.16 - http://www.slf4j.org)

@slawekjaranowski
Copy link
Member

@vitalijr2 - is it ok or not
If not please provide a source of test project and show what result should be

@vitalijr2
Copy link
Contributor

vitalijr2 commented Nov 15, 2024

@slawekjaranowski It's OK.

I has been browsing issues and found this one. But I remember this goal had worked for me well. Then I ran the build again - it still worked.

Also I remember that one time I saw the message

[INFO] --- license:2.4.0:aggregate-add-third-party (default-cli) @ xxxxxx ---
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...

but now it doesn't appear. 😕 It is also OK, but maybe this issue throws in some special conditions or maybe misconfiguration.

@ma345564280, could you provide a test project? Tnx.

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

No branches or pull requests

3 participants