summary: Provide a converter to turn a pom.xml into a native Gradle build file. status: Planned Soon code: planned
A first implementation in this direction already exist by the Maven Converter Plugin. We want to merge the basic functionality into the Gradle core and evolve it step by step from there.
This would be a great learning tool for people new to Gradle, like myself. I would also minimize the rather high barrier of converting existing Maven projects to Gradle.
A basic version is planned for 1.2. This would amongst other things ignore any custom Maven plugins but will be nonetheless a great help, if just for not manually converting the dependency notations.
I tried “gradle setupBuild” with gradle-1.7, it failed with my projects(multiple one). I just tried with gradle-1.9, “gradle init” works fine for my case, great job!
Just some comments for the conversion results:
It’s better to have libraries.gradle to manage those dependencies in “dependencyManagement” section. That would be cleaner for developers. I had those logic in my tool, not sure whether git init need it, if it is, I can provide patch for git init.
I saw settings.gradle include additional infos for project dependencies, are those info necessary?
At least, for gradle 1.7, only include those “project modules”, that file is clearer.
add for gradle base on maven’s , that’s great. but my question is: maven might have scattered to exclude one specific dependency. That’s not good. “git init” could be smarter, if found there are multiple for one dependency, might provide a central/clearer way to exclude that dependency.
I just converted a pom to a build.gradle with ‘gradle init --type pom’ using Gradle 1.11, and I can’t force it to actually build the project. Everytime I run ‘gradle clean build’, it says everything is UP-TO-DATE:
$ gradle clean build
:clean
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar
:assemble
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check UP-TO-DATE
:build
BUILD SUCCESSFUL
Total time: 5.316 secs
It also never runs my tests if I run ‘gradle cleanTest test’. I’ve changed files, changed the build dependencies, etc, and can’t get anything to make it build with Gradle. What can I do to make it actually build?