ip696
ip696

Reputation: 7084

How can I add gradle-api library to my project?

I have a spring boot project build with Gradle. When I clean/build project, I have these external libraries, marked as library root. And I can use it in my classes: import org.gradle.api.tasks.*

enter image description here

Now I create a new project, and these libraries absent. I don't understand how can I configure it. I want to use import org.gradle.api.tasks.* in a new project but I can't do it.

Upvotes: 5

Views: 2710

Answers (1)

M.Ricciuti
M.Ricciuti

Reputation: 12096

Just add the "gradleApi" into your new project dependencies :

dependencies {   
    implementation gradleApi()
}

See : https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/dsl/DependencyHandler.html#gradleApi--

Upvotes: 10

Related Questions