Eclipse Directory Structure Question


(Chris Caspanello) #1

Hey guys,

I’ve got 3 projects

  • MovieLibrary_Gradle

  • settings.gradle

  • build.gradle - MovieLibrary_WAR

  • build.gradle - MovieLibrary_EJB

  • build.gradle

I want the Gradle project to call the build.gradle scripts in the WAR and EJB projects. I set up the Gradle project because I wanted an easy way to manage the gradle files (editing, project checkout from SVN, etc). I am having a problem referencing these WAR and EJB projects. I am not getting an error or anything; but if I manually monkey around with build paths in Eclipse and then do ‘gradle eclipseClean eclipse’ I do not see any change after I refresh my projects in Eclipse. That being said if I move my settings/build gradle outside of the Gradle project like this:

  • settings.gradle - build.gradle - MovieLibrary_WAR

  • build.gradle - MovieLibrary_EJB

  • build.gradle

Then it works. But once again, I loose the ability to have the Gradle scripts in a nice neat Eclipse project.

Any ideas?


(Peter Niederwieser) #2

If you want to use a flat directory layout, you should use ‘includeFlat’ instead of ‘include’ in ‘settings.gradle’. Alternatively, you can use the Eclipse Gradle tooling, which handles hierarchical directory layouts fine.


(Chris Caspanello) #3

Thanks for your quick reply Peter, I’ll give that a shot right how. Will post back shortly with my results. Thanks again.


(Chris Caspanello) #4

Thanks for the suggestion Peter it worked! So easy once you understand the key words.