GitHub user mkleint opened a pull request: https://github.com/apache/maven/pull/52
MNG-5288 prevent NPE, not all ProjectBuildingException instances have getResults() I have a reproducible scenario, cannot currently update/reopen MNG-5288 our in-house plugin is calling MavenProjectBuilder.buildFromRepository() which causes this problem for the case of a parent pom that is not of 'pom' packaging. (someone uploaded the wrong metadata apparently) ``` org.apache.maven.project.InvalidProjectModelException: Some problems were encountered while processing the POMs: [ERROR] Invalid packaging for parent POM com.atlassian.plugins:remote-link-aggregator:2.0.13, must be "pom" but is "jar" @ com.atlassian.plugins:remote-link-aggregator:2.0.13 [ERROR] 'dependencies.dependency.version' for com.atlassian.plugins.rest:atlassian-rest-module:jar is missing. @ line 84, column 21 [ERROR] 'dependencies.dependency.version' for com.google.guava:guava:jar is missing. @ line 89, column 21 [ERROR] 'dependencies.dependency.version' for com.google.code.findbugs:jsr305:jar is missing. @ line 94, column 21 for project at org.apache.maven.project.DefaultMavenProjectBuilder.transformError(DefaultMavenProjectBuilder.java:193) at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:240) at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:251) at com.atlassian.plugin.maven.license.ArtifactResolver.com$atlassian$plugin$maven$license$ArtifactResolver$$projectBuilder(ArtifactResolver.scala:120) at com.atlassian.plugin.maven.license.ArtifactResolver$$anonfun$allArtifacts$1$$anonfun$apply$3.apply(ArtifactResolver.scala:28) at com.atlassian.plugin.maven.license.ArtifactResolver$$anonfun$allArtifacts$1$$anonfun$apply$3.apply(ArtifactResolver.scala:28) at com.atlassian.plugin.maven.license.ArtifactDetails.license(ArtifactDetails.scala:27) at com.atlassian.plugin.maven.license.CompositeLicenseOps$$anonfun$license$1.apply(Stuff.scala:20) at com.atlassian.plugin.maven.license.CompositeLicenseOps$$anonfun$license$1.apply(Stuff.scala:20) at scala.Option.orElse(Option.scala:257) at com.atlassian.plugin.maven.license.CompositeLicenseOps.license(Stuff.scala:20) at com.atlassian.plugin.maven.license.LicenseHandler$$anonfun$run$1$$anonfun$allLicenses$lzycompute$1$1.apply(LicenseHandler.scala:22) at com.atlassian.plugin.maven.license.LicenseHandler$$anonfun$run$1$$anonfun$allLicenses$lzycompute$1$1.apply(LicenseHandler.scala:22) at scala.collection.TraversableLike$$anonfun$filterNot$1.apply(TraversableLike.scala:274) at scala.collection.TraversableLike$$anonfun$filterNot$1.apply(TraversableLike.scala:274) at scala.collection.TraversableLike$$anonfun$filter$1.apply(TraversableLike.scala:264) at scala.collection.immutable.List.foreach(List.scala:318) at scala.collection.TraversableLike$class.filter(TraversableLike.scala:263) at scala.collection.AbstractTraversable.filter(Traversable.scala:105) at scala.collection.TraversableLike$class.filterNot(TraversableLike.scala:274) at scala.collection.AbstractTraversable.filterNot(Traversable.scala:105) at com.atlassian.plugin.maven.license.LicenseHandler$$anonfun$run$1.allLicenses$lzycompute$1(LicenseHandler.scala:20) at com.atlassian.plugin.maven.license.LicenseHandler$$anonfun$run$1.com$atlassian$plugin$maven$license$LicenseHandler$$anonfun$$allLicenses$1(LicenseHandler.scala:20) at com.atlassian.plugin.maven.license.LicenseHandler$$anonfun$run$1$$anon$1.licenses(LicenseHandler.scala:26) at com.atlassian.plugin.maven.license.goal.Verify$$anonfun$apply$1.apply(Verify.scala:11) at com.atlassian.plugin.maven.license.goal.Verify$$anonfun$apply$1.apply(Verify.scala:9) at com.atlassian.plugin.maven.license.LicenseHandler$$anonfun$run$1.apply(LicenseHandler.scala:36) at com.atlassian.plugin.maven.license.LicenseHandler$$anonfun$run$1.apply(LicenseHandler.scala:18) at com.atlassian.plugin.maven.license.LicenseVerifyMojo.execute(LicenseVerifyMojo.java:27) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) 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:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) 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) [ERROR] Error executing Maven. [ERROR] null ``` You can merge this pull request into a Git repository by running: $ git pull https://github.com/mkleint/maven master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/maven/pull/52.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #52 ---- commit 32e76e0130bd5dbe51d8d45b155872defd419ee1 Author: Milos Kleint <mkle...@apache.org> Date: 2015-06-17T01:30:23Z MNG-5288 prevent NPE, not all ProjectBuildingException instances have getResults() ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org