What are the Maven dependency options for the Java Gradle API?

I am writing a Gradle plugin in Java. To use the IDE for development (especially to complete the code), I need to add dependency information for the org.gradle.api.* pom.xml project pom.xml file.

Where can I find him?

I tried mvnrepository.com , but could not find it there.

+8
java maven gradle gradle-plugin
source share
5 answers

I found this artifact after a longer search: https://maven-repository.com/artifact/org.gradle/gradle-core/2.2.1

 <dependency> <groupId>org.gradle</groupId> <artifactId>gradle-core</artifactId> <version>2.2.1</version> </dependency> 

The artifact is available in the following repository: http://repo.springsource.org/libs-release-remote/

 <repository> <id>Spring Source Libs</id> <url>http://repo.springsource.org/libs-release-remote/</url> </repository> 

Add the repository to the repository section of your pom.xml, as well as the artifact as a dependency. I tested it with the Maven project in the Eclipse workspace - the org.gradle.api classes are available. * And I can also browse gradle -core sources.

+11
source share

Use this:

 dependencies { //we will use the Groovy version that ships with Gradle: compile localGroovy() //our plugin requires Gradle API interfaces and classes to compile: compile gradleApi() } 
+2
source share

For those who read this in 2016 (and maybe later).

Artifacts are available in JCenter : org.gradle: gradle -core , no β€œcustom” repositories need to be added.

So all you have to do is:

 repositories { jcenter() } dependencies { compile 'org.gradle:gradle-core:2.14.1' // compile 'org.codehaus.groovy:groovy-all:2.4.4' } 
+2
source share

If you want to use the official Gradle release repository in Maven pom, try this:

 <dependencies> <dependency> <groupId>org.gradle</groupId> <artifactId>gradle-core</artifactId> <version>3.4.1</version> </dependency> <dependency> <groupId>org.gradle</groupId> <artifactId>gradle-tooling-api</artifactId> <version>3.4.1</version> </dependency> <dependency> <groupId>org.gradle</groupId> <artifactId>gradle-base-services</artifactId> <version>3.4.1</version> </dependency> <dependency> <groupId>org.gradle</groupId> <artifactId>gradle-base-services-groovy</artifactId> <version>3.4.1</version> </dependency> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> <version>2.4.10</version> </dependency> </dependencies> <repositories> <repository> <id>repo.gradle.org</id> <url>https://repo.gradle.org/gradle/libs-releases-local/</url> </repository> </repositories> 
+1
source share

In my experience, as of summer'19 the last artifact was published in the following repository:

 repositories { maven { url "https://repo.gradle.org/gradle/libs-releases-local" } } dependencies { compileOnly "org.gradle:gradle-core:5.5.1" } 
0
source share

All Articles