[ https://jira.codehaus.org/browse/MSITE-644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=301212#comment-301212 ]
Samuel Langlois commented on MSITE-644: --------------------------------------- I completely agree that it makes no sense! It's just that if the error had been a little nicer, I would not have spent one hour searching why the site generation failed :-) Anyway, even if it is never fixed, people who google this error will hopefully get to this page now... > NullPointerException when site URL is not defined in distributionManagement > --------------------------------------------------------------------------- > > Key: MSITE-644 > URL: https://jira.codehaus.org/browse/MSITE-644 > Project: Maven 2.x and 3.x Site Plugin > Issue Type: Bug > Affects Versions: 3.0, 3.1 > Reporter: Samuel Langlois > Priority: Minor > Attachments: pom.xml > > > If you forget to specify the url in the site section: > {code} > <distributionManagement> > <site> > <id>alfresco.website</id> > </site> > </distributionManagement> > {code} > you get a nasty NullPointerException. > {code} > [INFO] > ------------------------------------------------------------------------ > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:3.0:site (default-site) on project > alfresco: Execution default-site of goal > org.apache.maven.plugins:maven-site-plugin:3.0:site failed. > NullPointerException -> [Help 1] > org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal org.apache.maven.plugins:maven-site-plugin:3.0:site (default-site) on > project alfresco: Execution default-site of goal > org.apache.maven.plugins:maven-site-plugin:3.0:site failed. > at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225) > 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:84) > at > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) > at > org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) > at > org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) > at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) > at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) > at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at > org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) > at > org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) > at > org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) > at > org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) > Caused by: org.apache.maven.plugin.PluginExecutionException: Execution > default-site of goal org.apache.maven.plugins:maven-site-plugin:3.0:site > failed. > at > org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110) > at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) > ... 19 more > Caused by: java.lang.NullPointerException > at java.io.File.<init>(File.java:222) > at > org.apache.maven.doxia.tools.DefaultSiteTool.urlEncode(DefaultSiteTool.java:1478) > at > org.apache.maven.doxia.tools.DefaultSiteTool.getDistMgmntSiteUrl(DefaultSiteTool.java:1451) > at > org.apache.maven.doxia.tools.DefaultSiteTool.appendMenuItem(DefaultSiteTool.java:1380) > at > org.apache.maven.doxia.tools.DefaultSiteTool.populateModulesMenuItemsFromModels(DefaultSiteTool.java:1344) > at > org.apache.maven.doxia.tools.DefaultSiteTool.populateModulesMenu(DefaultSiteTool.java:905) > at > org.apache.maven.doxia.tools.DefaultSiteTool.getDecorationModel(DefaultSiteTool.java:488) > at > org.apache.maven.plugins.site.AbstractSiteRenderingMojo.createSiteRenderingContext(AbstractSiteRenderingMojo.java:286) > at > org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:154) > at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:138) > at > org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) > {code} > You can try executing {{mvn site -N}} with the attached pom file. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira