Reputation: 1175
We have maven (pom.xml) project and want to convert this into using gradle.(build.gradle). Can anyone tell me how to convert maven project to gradle project?
Upvotes: 3
Views: 7804
Reputation: 22376
There are articles that can be found on google that can help. Example - http://www.jayway.com/2013/05/12/getting-started-with-gradle/
Assuming this is a java project. The simplest thing to get started is - create build.gradle
in the same directory as pom.xml
.
apply plugin: 'java' #Java project - standard maven directory structure expected
repositories {
mavenCentral() #Download dependencies from maven central
}
dependencies {
compile = "org.apache.ant:ant:1.8.1" #As an example - ant dependency
}
And that is it as a simple starting point - Dependencies have been declared and the project is a java one. To run jUnit tests - gradle test
, to jar gradle jar
.
If you want to invoke a main()
function
apply plugin: 'application'
mainClassName=com.coyote.Foo
To invoke gradle run
All the information on gradle is available on http://www.gradle.org/docs/current/userguide/userguide.html
Upvotes: 2