Strange behavior in multi module build


(Harald Bittermann) #1

I have the following project structure:

  • root
  • domain-core
    • intf
    • impl
  • domain
    • impl
    • intf

settings.gradle includes ‘domain-core:intf’ ‘domain-core:impl’, ‘doamain:intf’ and ‘domain:impl’

domain/impl/build.gradle contains a dependency to domain-core/intf

compile project(’:domain-core:intf’)

However, “gradle build” complains about compile errors. Apparently the compiler can not find a class when compiling domain/impl. But the class is definitly included in domain-core/intf. Also in eclipse (using gradle STS plugin) domain-core:intf is not listed under “gradle dependencies” in the project explorer.

I am sure there is a reason for this behavior. I just can’t figure it out…

=== build output ===
:domain-core:intf:compileJava
:domain-core:intf:processResources UP-TO-DATE
:domain-core:intf:classes
:domain-core:intf:jar
:domain:intf:compileJava
:domain:intf:processResources UP-TO-DATE
:domain:intf:classes
:domain:intf:jar
:domain:impl:compileJava
/…somepath…/domain/impl/src/main/java/net/d80harri/coach/domain/DomainContext.java:5: error: package net.d80harri.coach.domain.repository does not exist
import net.d80harri.coach.domain.repository.IDomainCoreContext;


(Stefan Oehme) #2

Hi Harald,

can you attach a small example project that reproduces this problem?

Cheers,
Stefan