[GRADLE-2666] maven2Gradle runs into Nullpointer Created: 31/Jan/13  Updated: 28/Jun/13  Resolved: 28/Jun/13

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 1.7-rc-1

Type: Bug
Reporter: Gradle Forums Assignee: René Gröschke (Inactive)
Resolution: Fixed Votes: 9

Attachments: Zip Archive dpjw.zip    

 Description   

I have a legacy maven multi project, and I tried to generate appriopriate Gradle-build scripts using task maven2Gradle. I already tried this with 1.2 with success, but with some minor problems I reported.

With Gradle 1.4, I now run into a Nullpointer exception the Gradle folks might have a look on it:

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':maven2Gradle'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.
    java:72)
    (...)
    Caused by: org.gradle.api.GradleException: Unable to create maven project model using pom file: C:\devpacks\dpjw\maven-p
    rj\dpjwApp\pom.xml
    at org.gradle.api.plugins.maven.internal.MavenProjectsCreator.create(MavenProjectsCreator.java:54)
    Caused by: java.lang.NullPointerException
    at org.gradle.mvn3.org.apache.maven.plugin.CacheUtils.getWorkspace(CacheUtils.java:207)
    at org.gradle.mvn3.org.apache.maven.plugin.DefaultPluginArtifactsCache$CacheKey.<init>(DefaultPluginArtifactsCac
    he.java:67)
    at org.gradle.mvn3.org.apache.maven.plugin.DefaultPluginArtifactsCache.createKey(DefaultPluginArtifactsCache.jav
    a:141)
    at org.gradle.mvn3.org.apache.maven.project.DefaultProjectBuildingHelper.createProjectRealm(DefaultProjectBuildi
    ngHelper.java:223)
    at org.gradle.mvn3.org.apache.maven.project.DefaultModelBuildingListener.buildExtensionsAssembled(DefaultModelBu
    ildingListener.java:106)
    at org.gradle.mvn3.org.apache.maven.model.building.ModelBuildingEventCatapult$1.fire(ModelBuildingEventCatapult.
    java:43)
    at org.gradle.mvn3.org.apache.maven.model.building.DefaultModelBuilder.fireEvent(DefaultModelBuilder.java:1053)
    at org.gradle.mvn3.org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:388)
    at org.gradle.mvn3.org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:371)
    at org.gradle.mvn3.org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:560)
    at org.gradle.mvn3.org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:566)
    at org.gradle.mvn3.org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:352)
    at org.gradle.api.plugins.maven.internal.MavenProjectsCreator.createNow(MavenProjectsCreator.java:83)
    at org.gradle.api.plugins.maven.internal.MavenProjectsCreator.create(MavenProjectsCreator.java:52)


 Comments   
Comment by Carlo Luib-Finetti [ 31/Jan/13 ]

included you will find the poms of the maven project to be gradled

Comment by Kelly Robinson [ 16/Mar/13 ]

I see this same stack trace using 1.5-rc-1 on a multi-module project. I'd try to debug into it, but I couldn't find the source for the jarjar'd mvn3 code where the NPE is happening.

Comment by Nikita Salnikov-Tarnovski [ 27/Apr/13 ]

Can something be done with this issue? I have the very same exception with both Gradle 1.5 and latest nightly of 1.7.

Comment by Nikita Salnikov-Tarnovski [ 07/May/13 ]

And just released 1.6 still has the very same problem.

Comment by Nikita Salnikov-Tarnovski [ 14/May/13 ]

Are there any plans to fix this NPE?

Comment by Nikita Salnikov-Tarnovski [ 23/Jun/13 ]

Just checked the latest nightly 1.7-20130621220026+0000. One of the projects, that has failed before, now works correctly. Thank you

The other one fails with:

Caused by: java.lang.StackOverflowError
at org.gradle.buildsetup.plugins.internal.maven.Maven2Gradle.generateFqn(Maven2Gradle.groovy:253)
at org.gradle.buildsetup.plugins.internal.maven.Maven2Gradle.this$2$generateFqn(Maven2Gradle.groovy)
at org.gradle.buildsetup.plugins.internal.maven.Maven2Gradle$this$2$generateFqn.callCurrent(Unknown Source)
at org.gradle.buildsetup.plugins.internal.maven.Maven2Gradle.generateFqn(Maven2Gradle.groovy:253)
at org.gradle.buildsetup.plugins.internal.maven.Maven2Gradle.this$2$generateFqn(Maven2Gradle.groovy)
at org.gradle.buildsetup.plugins.internal.maven.Maven2Gradle$this$2$generateFqn.callCurrent(Unknown Source)
at org.gradle.buildsetup.plugins.internal.maven.Maven2Gradle.generateFqn(Maven2Gradle.groovy:253)
at org.gradle.buildsetup.plugins.internal.maven.Maven2Gradle.this$2$generateFqn(Maven2Gradle.groovy)
at org.gradle.buildsetup.plugins.internal.maven.Maven2Gradle$this$2$generateFqn.callCurrent(Unknown Source)

Comment by Adam Murdoch [ 28/Jun/13 ]

@Nikita, can you add a separate issue in the forums for the StackOverflowError, please?

Generated at Wed Jun 30 12:28:08 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.