Reputation: 50488
I have a maven project that I'd like to convert so that it builds using Gradle. it seems that gradle isn't detecting the pom.xml file though:
$ gradle -v
------------------------------------------------------------
Gradle 1.11
------------------------------------------------------------
Build time: 2014-02-11 11:34:39 UTC
Build number: none
Revision: a831fa866d46cbee94e61a09af15f9dd95987421
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.9.2 compiled on July 8 2013
Ivy: 2.2.0
JVM: 1.7.0_45 (Oracle Corporation 24.45-b08)
OS: Windows 7 6.1 amd64
$ ls
pom.xml src target
$ gradle setupBuild --info
Starting Build
Settings evaluated using empty settings script.
Projects loaded. Root project using empty build file.
Included projects: [root project 'simple-service-webapp']
Evaluating root project 'simple-service-webapp' using empty build file.
All projects evaluated.
FAILURE: Build failed with an exception.
* What went wrong:
Task 'setupBuild' not found in root project 'simple-service-webapp'.
* Try:
Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
BUILD FAILED
Total time: 1.589 secs
Upvotes: 1
Views: 2534
Reputation: 2030
Gradle doesn't read the pom.xml file to build the project. But it does all the same things the pom normally describes. In your gradle script you must specify the repository location and the dependencies, then gradle should build your project as you expect.
You are supposed to be able to convert a maven project into a gradle project in version 1.11 by using the "init" plugin.
gradle init --type pom
Upvotes: 4