maven2Gradle runs into Nullpointer


(Carlo Luib-Finetti) #1

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)

(Luke Daley) #2

Hi Carlo,

This will be very difficult to debug without being able to reproduce it locally. Would you be able to provide a reproducible sample?


(Carlo Luib-Finetti) #3

Hi Luke, I can zip the project poms into a file and send it by mail?


(Luke Daley) #4

HI Carlo,

Would you be willing to attach it to GRADLE-2666 ?


(Carlo Luib-Finetti) #5

ok, done


(Luke Daley) #6

Many thanks.


(Mathias Lin) #7

I can confirm the issue also here on my side.

Using gradle 1.4, I just tried to convert my maven pom.xml to gradle, but it fails.

I followed the steps at http://www.gradle.org/docs/current/us

pom.xml: http://pastebin.com/AVahZjZF

Error log at: http://pastebin.com/FLKh6kQq