Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I build a Gradle plugin with Maven

Tags:

maven

gradle

It's possible to build a Gradle plugin with Maven. Which dependencies are needed?

like image 826
Mirko Ebert Avatar asked Dec 18 '14 20:12

Mirko Ebert


People also ask

Can I use a Gradle plugin in Maven?

Gradle ships with a Maven plugin, which adds support to convert a Gradle file to a Maven POM file. It can also deploy artifacts to Maven repositories. The plugin uses the group and the version present in the Gradle file and adds them to the POM file. Also, it automatically takes the artifactId from the directory name.

Is Gradle build on Maven?

Gradle is a build automation tool that is an open-source and builds based on the concepts of Apache Maven and Apache Ant. It is capable of building almost any type of software.

How do I convert Maven plugins to Gradle?

To convert Maven to Gradle, the only step is to run gradle init in the directory containing the POM. This will convert the Maven build to a Gradle build, generating a settings. gradle file and one or more build. gradle files.


1 Answers

Yes, it's possible. We do so with Spring Boot's Gradle plugin using these dependencies:

<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy</artifactId>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>org.gradle</groupId>
    <artifactId>gradle-core</artifactId>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>org.gradle</groupId>
    <artifactId>gradle-base-services</artifactId>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>org.gradle</groupId>
    <artifactId>gradle-base-services-groovy</artifactId>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>org.gradle</groupId>
    <artifactId>gradle-plugins</artifactId>
    <scope>provided</scope>
</dependency>

Groovy's in Maven Central, but the Gradle dependencies are in their own repo: http://repo.gradle.org/gradle/libs-releases-local

like image 115
Andy Wilkinson Avatar answered Nov 15 '22 11:11

Andy Wilkinson