Status of maven2gradle plugin in 1.2


#1

What happened to maven2gradle in 1.2? Is it still there or…? I see no reference to it in the release note.


(Peter Niederwieser) #2

The maven2gradle feature is part of 1.2 but didn’t get much press because it’s incubating and in an early stage.


#3

Thanks for the reply. I tried it out when it came out in the RC and when I revisited using it in the new release my impression was that somehow it had become more sensitive to obscurities in our pom files.

… so I wasn’t sure if this was because the plugin was broken in 1.2 or what had happened.

I’ve since been able to get on track again. FYI, maven2Gradle appears to take issue with:

< packaging >ourcustompackaging< /packaging >

and:

< parent >

< /parent >

declarations.

Since these are in our case (don’t know about other use cases) Maven specific hacks that would not survive a gradle migration, it would probably make sense if it ignored it somehow.

As it is now, it just dies with:

Wait, obtaining effective pom…

:maven2Gradle FAILED

FAILURE: Build failed with an exception.

  • What went wrong:

Execution failed for task ‘:maven2Gradle’.

exec returned: 1

which is as useful as Maven is. But maybe this is because that is what Gradle is doing at this step, ie. calling Maven?

Is there a way to feed in a variable to Maven when using the maven2Gradle plugin?

(sorry for the many updates, I wasn’t familiar with the markdown syntax)


(Szczepan Faber) #4

Can you try using the maven2Gradle from gradle nightly? We’ve just improved it, so that it no longer needs ‘mvn’ on the path. It’s using embedded maven.

“exec returned: 1” is probably because the “mvn help:effectivePom” command that was issued had failed. I would check if it successfully runs from the command line. However, I’m not sure if it makes sense to dig into that since we no longer fork off a separate ‘exec’ process to obtain the effective pom.


#5

I tried just now with a PATH that didn’t contain any mvn.

It still fails ungracefully with:

11:42:15.051 [LIFECYCLE] [org.gradle.TaskExecutionLogger] :maven2Gradle FAILED

11:42:15.058 [ERROR] [org.gradle.BuildExceptionReporter]

11:42:15.059 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.

11:42:15.060 [ERROR] [org.gradle.BuildExceptionReporter]

11:42:15.061 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:

11:42:15.062 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ‘:maven2Gradle’.

11:42:15.062 [ERROR] [org.gradle.BuildExceptionReporter] > Unable to create MavenProject model.

11:42:15.065 [ERROR] [org.gradle.BuildExceptionReporter]

11:42:15.066 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:

11:42:15.067 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:maven2Gradle’.

11:42:15.067 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:68)


(Szczepan Faber) #6

Can you provide the stack trace (please past it in https://gist.github.com)?


#7

Using the latest nightly build:

git://gist.github.com/3819042.git


(Szczepan Faber) #8

The url does not work for me. Can you double check?


#9

Try https://gist.github.com/3819042 if you couldn’t get to it via git.


(dan) #10

Same issue for me


(Szczepan Faber) #11

Can you provide more details on what is causing this problem? E.g. is there anything specific in the poms? Is it still the case of problematic parent and packaging declarations as reported initially in this report?


(Mathias Lin) #12

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