https://bugzilla.redhat.com/show_bug.cgi?id=1344641
Bug ID: 1344641 Summary: builddep mojo NPE on pomless projects Product: Fedora Version: rawhide Component: xmvn Assignee: mizdebsk@redhat.com Reporter: msimacek@redhat.com QA Contact: extras-qa@fedoraproject.org CC: java-sig-commits@lists.fedoraproject.org, mat.booth@redhat.com, mizdebsk@redhat.com, msimacek@redhat.com, msrb@redhat.com
Description of problem: XMVn builddep mojo crashes with NPE on tycho-pomless projects. This is because Model.getLocation("") returns null for these. I inspected the object in debugger and location hashmap contains only "properties" key which probably got there via pom inheritance. I'm not sure of a correct solution. AFAIK location tracking is not mandatory in maven, so XMVn, shouldn't rely on it (determine whether dep/plugin was inherited by walking the graph?). Or it would probably be more straightforward to patch polyglot to set the location. Or use the "properties" key.
Stacktrace: [ERROR] Failed to execute goal org.fedoraproject.xmvn:xmvn-mojo:2.5.0:builddep (default-cli) on project eclipse-abrt: Execution default-cli of goal org.fedoraproject.xmvn:xmvn-mojo:2.5.0:builddep failed. NullPointerException -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.fedoraproject.xmvn:xmvn-mojo:2.5.0:builddep (default-cli) on project eclipse-abrt: Execution default-cli of goal org.fedoraproject.xmvn:xmvn-mojo:2.5.0:builddep failed. 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 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:498) 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.PluginExecutionException: Execution default-cli of goal org.fedoraproject.xmvn:xmvn-mojo:2.5.0:builddep failed. at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) ... 20 more Caused by: java.lang.NullPointerException at org.fedoraproject.xmvn.mojo.BuilddepMojo.execute(BuilddepMojo.java:143) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) ... 21 more
Version-Release number of selected component (if applicable): xmvn-0:2.5.0-7.fc25.noarch
How reproducible: always
Steps to Reproduce: 1. rebuild eclipse-abrt
https://bugzilla.redhat.com/show_bug.cgi?id=1344641
Mikolaj Izdebski mizdebsk@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED
--- Comment #1 from Mikolaj Izdebski mizdebsk@redhat.com --- Integration test: https://github.com/mizdebsk/xmvn/commit/4ddcb4c4a761e3a270000b7c7b8e21dca01b... Proposed fix: https://github.com/mizdebsk/tycho-pomless/commit/afa459efd8375aff315685934b0...
Michael, WDYT about this approach?
https://bugzilla.redhat.com/show_bug.cgi?id=1344641
--- Comment #2 from Michael Simacek msimacek@redhat.com --- Looks good to me.
I have one more suggestion for builddep - since it's non-critical part of the build that doesn't have any effect on the resulting RPMs, could it just log exceptions without failing the build?
https://bugzilla.redhat.com/show_bug.cgi?id=1344641
--- Comment #3 from Mikolaj Izdebski mizdebsk@redhat.com --- (In reply to Michael Simacek from comment #2)
I have one more suggestion for builddep - since it's non-critical part of the build that doesn't have any effect on the resulting RPMs, could it just log exceptions without failing the build?
I'm afraid that we would miss potential problems when doing so. It's the same philosophy that we follow to fail the build on test failure - tests don't have any effect on resulting RPMs either.
Instead, how about adding an option to skip builddep? It could be used to unbreak builds until XMvn is fixed.
https://bugzilla.redhat.com/show_bug.cgi?id=1344641
--- Comment #4 from Mikolaj Izdebski mizdebsk@redhat.com --- Skip property implemented in https://github.com/mizdebsk/xmvn/commit/b776efb275d9d7c06952d12f73c0cf20f78a...
https://bugzilla.redhat.com/show_bug.cgi?id=1344641
--- Comment #5 from Michael Simacek msimacek@redhat.com --- Ok. But do you need skip property in XMVn at all? Builddep execution is put there by mvn_build macro, wouldn't it be better to have the option there as commandline parameter?
https://bugzilla.redhat.com/show_bug.cgi?id=1344641
--- Comment #6 from Mikolaj Izdebski mizdebsk@redhat.com --- Patch submitted upstream: https://git.eclipse.org/r/75453/
https://bugzilla.redhat.com/show_bug.cgi?id=1344641
--- Comment #8 from Mat Booth mat.booth@redhat.com --- Is this fixed? A recent build of a pomless project seems to show builddep working correctly:
https://kojipkgs.fedoraproject.org//packages/eclipse-abrt/0.0.3/3.fc27/data/...
https://bugzilla.redhat.com/show_bug.cgi?id=1344641
Mikolaj Izdebski mizdebsk@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |CLOSED Resolution|--- |RAWHIDE Last Closed| |2017-07-27 07:02:56
--- Comment #9 from Mikolaj Izdebski mizdebsk@redhat.com --- It seems to be fixed indeed!
I've merged integration test into master: https://github.com/fedora-java/xmvn/commit/f133ac7 And it passed: https://travis-ci.org/fedora-java/xmvn/builds/258095823
Running org.fedoraproject.xmvn.it.BuilddepIntegrationTest Tests run: 14, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 77.118 sec - in org.fedoraproject.xmvn.it.BuilddepIntegrationTest
java-sig-commits@lists.fedoraproject.org