I have created a testproject with two modules in it. ModuleA and ModuleB.
ModuleA have a flatdir repo with a jar file in it and a compiletime dependency on it.
ModuleB depends on ModuleA and i would expect it to also compile when it accesses the jarfile as it should inherit the compiledependencies. But it dont.
When building ModuleA i get:
Executing external task ‘build’…
:ModuleA:compileJava
:ModuleA:processResources UP-TO-DATE
:ModuleA:classes
:ModuleA:jar
:ModuleA:assemble
:ModuleA:compileTestJava UP-TO-DATE
:ModuleA:processTestResources UP-TO-DATE
:ModuleA:testClasses UP-TO-DATE
:ModuleA:test UP-TO-DATE
:ModuleA:check UP-TO-DATE
:ModuleA:build
BUILD SUCCESSFUL
When building ModuleB i get:
Executing external task ‘build’…
:ModuleA:compileJava UP-TO-DATE
:ModuleA:processResources UP-TO-DATE
:ModuleA:classes UP-TO-DATE
:ModuleA:jar UP-TO-DATE
FAILURE: Build failed with an exception.
- What went wrong:
Could not resolve all dependencies for configuration ‘:ModuleB:compileClasspath’.
Could not find :Mylib:1.0-SNAPSHOT.
Searched in the following locations:
https://repo1.maven.org/maven2//Mylib/1.0-SNAPSHOT/maven-metadata.xml
https://repo1.maven.org/maven2//Mylib/1.0-SNAPSHOT/Mylib-1.0-SNAPSHOT.pom
https://repo1.maven.org/maven2//Mylib/1.0-SNAPSHOT/Mylib-1.0-SNAPSHOT.jar
Required by:
ModuleDependency:ModuleB:1.0-SNAPSHOT > ModuleDependency:ModuleA:1.0-SNAPSHOT
- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
:ModuleB:compileJava
BUILD FAILED
Total time: 1.103 secs
Could not find :Mylib:1.0-SNAPSHOT.
Searched in the following locations:
https://repo1.maven.org/maven2//Mylib/1.0-SNAPSHOT/maven-metadata.xml
https://repo1.maven.org/maven2//Mylib/1.0-SNAPSHOT/Mylib-1.0-SNAPSHOT.pom
https://repo1.maven.org/maven2//Mylib/1.0-SNAPSHOT/Mylib-1.0-SNAPSHOT.jar
Required by:
ModuleDependency:ModuleB:1.0-SNAPSHOT > ModuleDependency:ModuleA:1.0-SNAPSHOT
21:50:46: External task execution finished ‘build’.
I would expect it to compile and find Mylib in the flatDir repo of moduleA.
I have attached an exampleproject
ModuleDependency.zip (61.1 KB)