I'm writing a Gradle plugin in Java. In order to use the IDE for developing (especially code completion), I need to add to the pom.xml file of the project the dependency information for the org.gradle.api.* classes.
Where can I find it?
I tried mvnrepository.com, but couldn't find it there.
If you want to use the official Gradle Releases repository in a 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>
                        I found this artifact after a longer search: https://mvnrepository.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 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 repositories section in your pom.xml as well as the artifact as dependency. I tested it with a Maven project in my Eclipse workspace - the org.gradle.api.* classes are available and I can also browse the gradle-core sources.
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()
}
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With