Convert maven project to gradle - init task does not exist

I have a java-maven project. I want to convert it to gradle, so I did:

gradle init --type pom 

And I have an error:

FAILURE: Could not determine which tasks to execute.

* What went wrong:
Task 'init' not found in root project 'my-project'.

* Try:
Run gradle tasks to get a list of available tasks.

BUILD FAILED

Total time: 1.78 secs

I have the latest version of gradle:

$ gradle --version

------------------------------------------------------------
Gradle 1.4
------------------------------------------------------------

Gradle build time: Monday, September 9, 2013 8:44:25 PM UTC
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.9.3 compiled on April 8 2014
Ivy: non official version
JVM: 1.7.0_51 (Oracle Corporation 24.51-b03)
OS: Linux 3.13.0-24-generic amd64
+4
source share
3 answers

Are you sure you do not have a multi-project build? In particular, make sure that you have not yet started the gradle project in the directory one level higher.

+3
source

I had the same problem on Debian. I installed gradle using apt-get. He installed version 1.5. (it was built in 2014)

Then I installed gradle manually , and now it works fine.

0
source

To complete the answer mate00 ... Say, "my-project" is a subproject that does not work on init. If you have a multi- include 'my-project'project assembly, and you have a line in the main settings.gradle file of the project, it will throw this error.

The solution is to comment include 'my-project'in the main settings of .gradle projects, run the init command in my-project, and then uncomment this line.

0
source

All Articles