Gradle has developed rapidly over the years, and a growing number of GitHub projects are beginning to be built using Gradle, but not everyone is familiar with Gradle, and the following approach can turn Gradle into a maven project, Premise Gradle The project directory structure remains the same as Maven's, that is,/src/main/java this set.
One, Gradle---maven
Add the following in Build.gradle (Group,version can modify itself, artifactid default to the directory name)
Apply plugin: ' java '
Apply plugin: ' maven '
Group = ' Com.101tec '
Version = ' 0.7-dev '
Sourcecompatibility = 1.6
Then./gradlew build, after success will be generated in the Build\poms directory Pom-default.xml file, copy it to the root directory, renamed to Pom.xml can
Of course, you can also generate pom.xml directly from the root directory by modifying Build.gradle.
Task Writenewpom << { Pom { Project { inceptionyear ' licenses { license { Name ' The Apache software License, Version 2.0 ' url ' http://www.apache.org/licenses/LICENSE-2.0.txt ' distribution ' Repo '}}} }.writeto ("$buildDir/pom.xml")}
Two, maven--Gradle
First of all, ensure that the machine installed Gradle 2.0 or more versions
Then run it under the MAVEN root directory
Gradle init--type Pom
Further instructions on Gradle and how to use them are described in: https://lippiouyang.gitbooks.io/gradle-in-action-cn/content/gradle/gradle-features.html
Gradle and MAVEN projects transform each other