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

mvn site plugin fails with an NPE on license report generation #68

Closed
karianna opened this issue Aug 31, 2021 · 13 comments
Closed

mvn site plugin fails with an NPE on license report generation #68

karianna opened this issue Aug 31, 2021 · 13 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@karianna
Copy link
Member

karianna commented Aug 31, 2021

To reproduce uncomment the license plugin in the reporting section and run mvnw site

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.7.1:site (default-site) on project gctoolkit: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.7.1:site failed.: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.7.1:site (default-site) on project gctoolkit: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.7.1:site failed.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.7.1:site failed.
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.NullPointerException
    at java.util.HashSet.<init> (HashSet.java:119)
    at org.codehaus.mojo.license.api.ResolvedProjectDependencies.<init> (ResolvedProjectDependencies.java:50)
    at org.codehaus.mojo.license.AbstractThirdPartyReportMojo.createThirdPartyDetails (AbstractThirdPartyReportMojo.java:559)
    at org.codehaus.mojo.license.AggregatorThirdPartyReportMojo.createThirdPartyDetails (AggregatorThirdPartyReportMojo.java:127)
    at org.codehaus.mojo.license.AbstractThirdPartyReportMojo.executeReport (AbstractThirdPartyReportMojo.java:420)
    at org.apache.maven.reporting.AbstractMavenReport.generate (AbstractMavenReport.java:251)
    at org.apache.maven.plugins.site.render.ReportDocumentRenderer.renderDocument (ReportDocumentRenderer.java:230)
    at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render (DefaultSiteRenderer.java:349)
    at org.apache.maven.plugins.site.render.SiteMojo.renderLocale (SiteMojo.java:198)
    at org.apache.maven.plugins.site.render.SiteMojo.execute (SiteMojo.java:147)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    ```
@karianna karianna added bug Something isn't working help wanted Extra attention is needed labels Aug 31, 2021
@brunoborges
Copy link
Member

@karianna I just did a mvn site:site -Pcontributor locally and it all worked.

@karianna
Copy link
Member Author

karianna commented Sep 1, 2021

Did you uncomment the license plugin report? :-)

@brunoborges
Copy link
Member

I never thought it was commented out! Maybe a detail missed from this issue report :-D

@karianna
Copy link
Member Author

karianna commented Sep 1, 2021

It was a trap to be fair :-)

@brunoborges
Copy link
Member

Stop with the line-ending emojis! :-D

@anantk24
Copy link
Contributor

anantk24 commented Sep 3, 2021

I would like take this up . Assign this to me.

@karianna
Copy link
Member Author

karianna commented Sep 3, 2021

The myclin license plugin might be a better option here...

@anantk24
Copy link
Contributor

anantk24 commented Sep 3, 2021

Downgrading jars version <maven.license-plugin.version>1.20</maven.license-plugin.version> to works for me after uncommenting it. Refer here for details. Should I go ahead by downgrading version?

@karianna
Copy link
Member Author

karianna commented Sep 3, 2021

Downgrading jars version <maven.license-plugin.version>1.20</maven.license-plugin.version> to works for me after uncommenting it. Refer here for details. Should I go ahead by downgrading version?

Looks like the active maintenance on that project is pretty poor - could you give https://github.com/mathieucarbou/license-maven-plugin a try?

@anantk24
Copy link
Contributor

anantk24 commented Sep 8, 2021

Hi @karianna ,
I tried this executing locally, what documentation is suggesting that, it will either check , update , remove file headers based on license type. Same is happening when executed it. Ref.
Correct me if I am wrong, if we include it later, it has nothing to do with mvn site.
we will have goals to update license text in file headers.

@karianna
Copy link
Member Author

karianna commented Sep 9, 2021

Hi @karianna ,
I tried this executing locally, what documentation is suggesting that, it will either check , update , remove file headers based on license type. Same is happening when executed it. Ref.
Correct me if I am wrong, if we include it later, it has nothing to do with mvn site.
we will have goals to update license text in file headers.

Yes, you're correct, it is the wrong type of license checking.

I think the next steps are:

  1. Downgrade the plugin
    2.Get onto the mailing list of the maven license plugin from codehaus and see if any active maintainers are willing to help us fix the issue and get a release of 2.0.1 out.

@anantk24
Copy link
Contributor

Added pull request #91

@karianna
Copy link
Member Author

karianna commented Jul 5, 2023

2.2.0 plugin fixes this, I'll PR in a fix later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants