0

I've been digging into Gradle and loving it so far! I was delighted to find that apply plugin: 'eclipse' would easily generate an Eclipse project, but I'm irked by the fact that the dependency libraries show up under the root of the project in the Project Explorer view, like so:

Eclipse Project Explorer with generated project from Gradle

That seems unsustainable as the list of libraries expands. Yeah, it doesn't affect the functionality, but it's sure ugly. I'd rather group them into a Libraries "folder" or something like that. Does anyone know of an easy way? I'm thinking I can use withXml to monkey with the project definition, but it seems like someone else has probably thought of this and there must be a better way.

Bonus if I can easily see the subset of libraries that get packaged in (vs e.g. testCompile or providedCompile) when using the war plugin!

Chris Keller
  • 264
  • 1
  • 11
  • To be clear, the libraries are already grouped under your Gradle's cache. Unfortunately, that's as good as I can note because I am an IntelliJ user (better Gradle support! :)). If you know how to do it within Eclipse, then you can definitely modify the generated Eclipse file(s) by [using the hooks provided in the Eclipse plugin](http://www.gradle.org/docs/current/userguide/eclipse_plugin.html). – pickypg Jun 30 '14 at 03:35
  • Yeah, I think you have the gist: the actual storage on disk is fine and a non-concern. The grouping within the Eclipse project is what I'd like to fix, since that's what I have to see. Maybe I'll take a look at IntelliJ. – Chris Keller Jun 30 '14 at 03:59

1 Answers1

3

If you use Gradle Plugin for Eclipse developed by Pivotal folks there is an option to use classpath container that does what you want - it replaces individual classpath entries with one (expandable).

To enable this feature Right click on the project and select 'Gradle >> Enable Dependency Management'

Radim
  • 4,571
  • 1
  • 19
  • 25
  • Yeah, looks like the Eclipse Plugin for Gradle doesn't really support this, not that I could find anyway. The Gradle Plugin for Eclipse is able to do it as you described. – Chris Keller Jul 27 '14 at 03:56