mojohaus / license-maven-plugin

Maven plugin to download and collect license files from project dependencies.
https://www.mojohaus.org/license-maven-plugin/
GNU Lesser General Public License v3.0
106 stars 126 forks source link

THIRD-PARTY.properties is not generated #42

Closed solomax closed 7 years ago

solomax commented 8 years ago

It seems like THIRD-PARTY.properties files are not being generated for multi-module project if "aggregate-add-third-party" goal is used with "useMissingFile" option

Could you please fix it?

tchemit commented 7 years ago

can you provide a little project for show me the defect please. thanks.

cwelton commented 7 years ago

For me the fix was setting <failIfWarning>false</failIfWarning>, because the failed build prevented the generation of the file.

tchemit commented 7 years ago

@solomax Any chance to get a little project prooving the defect ? If not I will probably close this issue.

solomax commented 7 years ago

Will do after Jan, 8

WBR, Maxim (from mobile, sorry for the typos)

On Jan 3, 2017 23:57, "Tony CHEMIT" notifications@github.com wrote:

@solomax https://github.com/solomax Any chance to get a little project prooving the defect ? If not I will probably close this issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mojohaus/license-maven-plugin/issues/42#issuecomment-270163357, or mute the thread https://github.com/notifications/unsubscribe-auth/ADsPf9NTkeQgDk9YMOCPL9XDEM7Z1opaks5rOn4LgaJpZM4IpOpU .

solomax commented 7 years ago

Here it is: https://github.com/solomax/multimodule-with-war

tchemit commented 7 years ago

@solomax I tried to build your example project, but got an error :

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.082 s
[INFO] Finished at: 2017-01-09T09:08:05+01:00
[INFO] Final Memory: 28M/385M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project multimodule-with-war-server: Could not resolve dependencies for project org.apache.multimodule-with-war:multimodule-with-war-server:jar:1.0.0-SNAPSHOT: Could not find artifact org.apache.multimodule-with-war:multimodule-with-war-web:jar:1.0.0-SNAPSHOT in apache.snapshots (https://repository.apache.org/snapshots) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the err
solomax commented 7 years ago

Hello @tchemit, I have fixed the build, it now passes with license-maven-plugin disabled in build, and fails with it enabled. Not sure why :( As workaround you can install with license-maven-plugin disabled, then enable it and run again

tchemit commented 7 years ago

Ok now builds is fine. I can see generated third-parties files. Where is the problem ?

solomax commented 7 years ago

Unfortunately 7 months passes since I have tried this plugin :( If I do remember correctly src/license/THIRD-PARTY.properties files are being created for single module project. Now I can see **/target/generated-sources/license/THIRD-PARTY.txt is created for multimodule I'll try to restore old configuration and double check everything

Thanks for investigating

tchemit commented 7 years ago

Any update on this ? @solomax

solomax commented 7 years ago

Hello @tchemit, looking at it right now sorry for delay :(

solomax commented 7 years ago

@tchemit just have updated quickstart (have added library with no license) got following

[WARNING] No license name defined for org.apache.xbean--xbean-asm5-shaded--3.17

from Maven but no src/license/THIRD-PARTY.properties is generated

tchemit commented 7 years ago

what command did you execute ?

solomax commented 7 years ago

mvn clean install

tchemit commented 7 years ago

whic version of license-plugin ? should be 1.13

solomax commented 7 years ago

the latest

tchemit commented 7 years ago

can you give me your pom ?

solomax commented 7 years ago

https://github.com/solomax/multimodule-with-war/blob/master/pom.xml

tchemit commented 7 years ago

Ok first, i add to remove plugin invocation a first time to build the project. Then I just readd license plugin invocation and run a mvn install.

And everything was ok.

tchemit commented 7 years ago

Ok now I see you warning

tchemit commented 7 years ago

Ok I just get it. The third party missing is not generated because your dependecy has a license, but this license has just no name. you can see in the generated THIRD-PARTY.txt file, you will find out the license for your dependency (and his license url).

The only thing I cahnge change is the label of the warning : You are using a license for ... with no name

and I won't generate a missing file for this case (since there is a license ...)

Ok to you ?

solomax commented 7 years ago

Ok

solomax commented 7 years ago

Thanks

tchemit commented 7 years ago

you re welcome :)

solomax commented 7 years ago

@tchemit just have added library with no license to https://github.com/solomax/multimodule-with-war *.properties file is not being generated :(

solomax commented 7 years ago

@tchemit Just have added THIRD-PARTY.properties to the root of multimodule project have specified name as follows:

jaxen--jaxen--1.1.6=The Apache Software License, Version 2.0

and still getting

[WARNING] No license name defined for jaxen--jaxen--1.1.6

How to eliminate this?

solomax commented 7 years ago

I believe this issue need to be reopened

tchemit commented 7 years ago

Hi @solomax , in fact I just check again for this new weird license library (jaxen), and once again there is a license attached to this gav, but the license has no name.

Using the THID-PARTY.properties won't have any effect on this one since, it only helps when there is NO license attached to a gav.

To make it ore clear, I just change the message in log :

[INFO] --- license-maven-plugin:1.14-SNAPSHOT:add-third-party (add-third-party) @ multimodule-with-war-util ---
[WARNING] The license for jaxen--jaxen--1.1.4 has no name (but exist)
[WARNING] The license for org.apache.xbean--xbean-asm5-shaded--3.17 has no name (but exist)
[WARNING] The license for org.apache.xbean--xbean-asm5-shaded--3.17 has no name (but exist)

Ok to you ?

solomax commented 7 years ago

@tchemit Is there any option to override License name?

tchemit commented 7 years ago

Nope, but you can add the feature, I will see how to implement it ;)

solomax commented 7 years ago

I believe it is mix of #39 and #77 but for aggregate-add-third-party goal :) I can file separate issue, should I?

tchemit commented 7 years ago

Again yes :)

solomax commented 7 years ago

done! Thanks!