[ https://jira.codehaus.org/browse/MENFORCER-122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Scholte updated MENFORCER-122: ------------------------------------- Description: When adding a repository to maven plugin pom, like {code:xml} <repositories> <repository> <id>com.asual.maven.public</id> <name>Asual Public Repository</name> <url>http://www.asual.com/maven/content/groups/public</url> </repository> </repositories> {code} and having sandbox as parent {code:xml} <parent> <groupId>org.codehaus.mojo</groupId> <artifactId>mojo-sandbox-parent</artifactId> <version>9</version> </parent> {code} causes {{mvn install}} to throw a NPE: {noformat} [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce (mojo-enforcer-rules) on project lesscss-maven-plugin: Execution mojo-enforcer-rules of goal org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce failed. NullPointerException -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce (mojo-enforcer-rules) on project lesscss-maven-plugin: Execution mojo-enforcer-rules of goal org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce 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:319) 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 mojo-enforcer-rules of goal org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce 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 org.apache.maven.plugins.enforcer.RequireNoRepositories.findBannedRepositories(RequireNoRepositories.java:182) at org.apache.maven.plugins.enforcer.RequireNoRepositories.execute(RequireNoRepositories.java:110) at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:186) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) ... 20 more On the discussion forum it was mentioned it's not allowed to repo's: https://fisheye.codehaus.org/browse/mojo/trunk/mojo/mojo-parent/pom.xml?hb=true#to323 {noformat} After removing the repo {{mvn install}} works flawlessly. However the NPE makes it difficult to find out why {{mvn install}} was failing. was: When adding a repository to maven plugin pom, like <repositories> <repository> <id>com.asual.maven.public</id> <name>Asual Public Repository</name> <url>http://www.asual.com/maven/content/groups/public</url> </repository> </repositories> and having sandbox as parent <parent> <groupId>org.codehaus.mojo</groupId> <artifactId>mojo-sandbox-parent</artifactId> <version>9</version> </parent> causes mvn install to throw a NPE: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce (mojo-enforcer-rules) on project lesscss-maven-plugin: Execution mojo-enforcer-rules of goal org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce failed. NullPointerException -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce (mojo-enforcer-rules) on project lesscss-maven-plugin: Execution mojo-enforcer-rules of goal org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce 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:319) 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 mojo-enforcer-rules of goal org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce 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 org.apache.maven.plugins.enforcer.RequireNoRepositories.findBannedRepositories(RequireNoRepositories.java:182) at org.apache.maven.plugins.enforcer.RequireNoRepositories.execute(RequireNoRepositories.java:110) at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:186) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) ... 20 more On the discussion forum it was mentioned it's not allowed to repo's: https://fisheye.codehaus.org/browse/mojo/trunk/mojo/mojo-parent/pom.xml?hb=true#to323 After removing the repo mvn install works flawlessly. However the NPE makes it difficult to find out why mvn install was failing. > Adding repository causes NPE during mvn install > ----------------------------------------------- > > Key: MENFORCER-122 > URL: https://jira.codehaus.org/browse/MENFORCER-122 > Project: Maven 2.x Enforcer Plugin > Issue Type: Bug > Components: Standard Rules > Reporter: Marcel Overdijk > > When adding a repository to maven plugin pom, like > {code:xml} > <repositories> > <repository> > <id>com.asual.maven.public</id> > <name>Asual Public Repository</name> > <url>http://www.asual.com/maven/content/groups/public</url> > </repository> > </repositories> > {code} > and having sandbox as parent > {code:xml} > <parent> > <groupId>org.codehaus.mojo</groupId> > <artifactId>mojo-sandbox-parent</artifactId> > <version>9</version> > </parent> > {code} > causes {{mvn install}} to throw a NPE: > {noformat} > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce > (mojo-enforcer-rules) on project lesscss-maven-plugin: Execution > mojo-enforcer-rules of goal > org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce failed. > NullPointerException -> [Help 1] > org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce > (mojo-enforcer-rules) on project lesscss-maven-plugin: Execution > mojo-enforcer-rules of goal > org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce 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:319) > 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 > mojo-enforcer-rules of goal > org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce 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 > org.apache.maven.plugins.enforcer.RequireNoRepositories.findBannedRepositories(RequireNoRepositories.java:182) > > at > org.apache.maven.plugins.enforcer.RequireNoRepositories.execute(RequireNoRepositories.java:110) > > at > org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:186) > at > org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) > > ... 20 more > On the discussion forum it was mentioned it's not allowed to repo's: > https://fisheye.codehaus.org/browse/mojo/trunk/mojo/mojo-parent/pom.xml?hb=true#to323 > {noformat} > After removing the repo {{mvn install}} works flawlessly. > However the NPE makes it difficult to find out why {{mvn install}} was > failing. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira