1

I have an Eclipse workspace (to be more specific STS 3.6.4) with two projects:

project1
project2

Both projects are gradle projects, project1 provides classes I need in project2. Because of this I added project1 under Projects in Configure Build Path.

This works fine as long as I do not call Refresh all on gradle. Whenever I do this I have to setup the whole thing again. I know how I could add a jar of project1 to project2, but during my development phase I do not want to build jars all the times. And I have not yet setup a repository where I could publish project1.

Is there a way to tell gradle to include .java/.class files from other proects when run from STS ?

I tried things like this:

compile project( ":project1 )

(read about this here), but this does not have the intended effect. I read another stackoverflow post but have to admit I could not get remap jars to Gradle projects to work for me.

Community
  • 1
  • 1
Marged
  • 10,577
  • 10
  • 57
  • 99

1 Answers1

0

You may read up on 'transitive' dependencies in gradle.

For a practical example you can look at

Git android proj -> depends on 'CCL' proj AND 'CCL' depends on other stuff

In your main "build.gradle' you just include the first dependency( rest of chain of dependency is inferred using gradle transitive rules.

main proj sample

sub project

Robert Rowntree
  • 6,230
  • 2
  • 24
  • 43
  • Thanks for the hint, I get errors while processing the buildfile when I add the compile project stuff. Will check this tomorrow – Marged Jun 04 '15 at 21:36