Open v1v opened 6 years ago
Hi. Goal aggregate-add-third-party does not work for me, too. I always get "You should use missingFile parameter instead of deprecated aggregateMissingLicensesFile." although I use missingFile instead of aggregateMissingLicensesFile. Looking into code, probably aggregateMissingLicensesFile still has its default value and won't be null at any time?
Workaround: Set aggregateMissingLicensesFile to the same value as missingFile
But even with the workaround, the missingFileUrl won't be used at all and the missingFile won't be generated.
I recently merged a couple of fixes in this area. Could you please reproduce using a SNAPSHOT built from the current master?
Using the current master snapshot I get an error on execution on my windows 10.
[11:49:32] [ERROR] Failed to execute goal org.codehaus.mojo:license-maven-plugin:1.17-SNAPSHOT:add-third-party (default-cli) on project pad: could not execute goal AddThirdPartyMojo for reason : \dev\null (Das System kann den angegebenen Pfad nicht finden) -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:license-maven-plugin:1.17-SNAPSHOT:add-third-party (default-cli) on project pad: could not execute goal AddThirdPartyMojo for reason : \dev\null (Das System kann den angegebenen Pfad nicht finden)
Root cause is:
Caused by: java.io.FileNotFoundException: \dev\null (Das System kann den angegebenen Pfad nicht finden) at java.base/java.io.FileInputStream.open0(Native Method) at java.base/java.io.FileInputStream.open(FileInputStream.java:220) at java.base/java.io.FileInputStream.
(FileInputStream.java:158) at java.base/java.io.FileInputStream. (FileInputStream.java:113) at java.base/sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:86) at java.base/sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:184) at java.base/java.net.URL.openStream(URL.java:1117) at org.codehaus.mojo.license.api.DefaultThirdPartyTool.overrideLicenses(DefaultThirdPartyTool.java:618) at org.codehaus.mojo.license.AbstractAddThirdPartyMojo.overrideLicenses(AbstractAddThirdPartyMojo.java:1002) at org.codehaus.mojo.license.AbstractAddThirdPartyMojo.consolidate(AbstractAddThirdPartyMojo.java:751) at org.codehaus.mojo.license.AddThirdPartyMojo.doAction(AddThirdPartyMojo.java:173) at org.codehaus.mojo.license.AbstractLicenseMojo.execute(AbstractLicenseMojo.java:202)
@TorstenKruse Sorry for that. It is probably my fault. It is a pity that we still do not have a Windows CI. I am waiting for Mojohaus folks to check why it does not work yet.
@TorstenKruse could you please re-try now after I merged https://github.com/mojohaus/license-maven-plugin/pull/194 ?
@ppalaga After pulling current master the former exception is gone. But another arises. Would be nice to get another fix.
[14:34:18] [ERROR] Failed to execute goal org.codehaus.mojo:license-maven-plugin:1.17-SNAPSHOT:aggregate-download-licenses (default-cli) on project pad: Unable to parse license summary output file: e:\Projects_git\pad\target\generated-resources\licenses.xml: NullPointerException -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:license-maven-plugin:1.17-SNAPSHOT:aggregate-download-licenses (default-cli) on project pad: Unable to parse license summary output file: e:\Projects_git\pad\target\generated-resources\licenses.xml at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to parse license summary output file: e:\Projects_git\pad\target\generated-resources\licenses.xml at org.codehaus.mojo.license.AbstractDownloadLicensesMojo.loadLicenseInfo(AbstractDownloadLicensesMojo.java:597) at org.codehaus.mojo.license.AbstractDownloadLicensesMojo.execute(AbstractDownloadLicensesMojo.java:334) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) ... 20 more Caused by: java.lang.NullPointerException at java.base/java.io.File.
(File.java:359) at org.codehaus.mojo.license.AbstractDownloadLicensesMojo.loadLicenseInfo(AbstractDownloadLicensesMojo.java:590) ... 23 more
@TorstenKruse could you please check after https://github.com/mojohaus/license-maven-plugin/pull/198 was merged?
Build is successful now! But the strange warning is still there.
First the goal add-third-party is executed for each module of the multi-module project. This is fine. At last the aggregate-add-third-party is executed for the complete project and it still starts with the following messagen:
[08:29:58] [INFO] --- license-maven-plugin:1.17-SNAPSHOT:aggregate-add-third-party (default-cli) @ pad --- [08:29:58] [WARNING] [08:29:58] [WARNING] You should use missingFile parameter instead of deprecated aggregateMissingLicensesFile. [08:29:58] [WARNING] [08:29:58] [INFO] All files are up to date, skip goal execution.
@TorstenKruse thanks for your effort. From what you say, I am not sure what of the following is true:
Could you please confirm or deny these two statements?
Well, I'm not 100% sure too because my original fault was slightly different from the inital one of this issue. I think we should ask @v1v . For him the check did not run properly because of packaging jar combined with aggregate goal. For me the check did not run properly because the missingFileUrl was not handeled properly in aggregate.
When I try packaging "jar" for my multi-module project I get
'packaging' with value 'jar' is invalid. Aggregator projects require 'pom' as packaging from maven.
So I cannot reproduce your first point. The second one seems to be ok for me now except of the really misleading message which should be removed.
OK, let's keep this open, although I cannot tell this is a bug. An integration test demonstrating the issue would be highly welcome.
As for the the warning about missingFile and aggregateMissingLicensesFile, @TorstenKruse feel free to open a new issue.
ok, i created #207
For some reason when I use 1.14 version plus the '--projects' flag to just run the aggregate goal. it skips the multimodule as you can see below:
while if I use 1.13 it works as expected
Someone else already posted this issue: https://github.com/mojohaus/license-maven-plugin/issues/93 and I was able to reproduce in my multimodule project.
Any hints?
Thanks