unfettered
unfettered

Reputation: 351

Running Gradle inside Eclipse?

There appears to be an Eclipse plugin for Gradle, but no Gradle plugin for Eclipse...

Simply, I'd like to add a build.gradle to my Eclipse project, write its contents (including defining its dependencies), and then run it from inside Eclipse, the same way I can run Ant scripts from inside Eclipse.

When it runs, I'd expect the plugin to pull down all dependencies and make them available to my project's classpath in Eclipse.

If no such plugin exists, then I ask: what's the best way to develop in Eclipse, but keep your builds managed by Gradle? If I decide I need a new xyz.jar as a dependency for my code, how do I add it as a dependency in such a way that both Gradle and Eclipse will recognize it (and not throw compiler errors)?

Upvotes: 0

Views: 108

Answers (2)

David M. Karr
David M. Karr

Reputation: 15225

The Gradle plugin for Eclipse is part of the Spring IDE. It understands the dependencies specified in the build script and makes those available in the .classpath.

Upvotes: 0

Peter Niederwieser
Peter Niederwieser

Reputation: 123910

Either use the IDE project generation approach (gradle eclipse), or use the Eclipse Gradle Integration. In both cases, you'll want to apply plugin: "eclipse".

Upvotes: 1

Related Questions