Cześć,
Mam apkę złożoną z kilku submodułów, załóżmy że struktura wygląda tak:
1.Root projektu
1a. commons
1b. serviceA
1c. serviceB
W root mam dwa pliki build,gradle , oraz setting.gradle które wyglądają tak:
settings.gradle:
rootProject.name = 'root-projekt'
include ':common',
':serviceA',
':serviceB'
build.gradle
apply plugin: 'java'
subprojects {
version = '1.0'
}
repositories {
mavenCentral()
}
dependencies {
compile project(":common")
compile project(":serviceA")
compile project(":serviceB")
}
test {
useJUnitPlatform()
}
I teraz chciałbym żeby moduł serviceA mógł korzystać z commons, wyczytałem że lokalnie trzeba zrobić to tak:
W serviceA do settings.gradle dodaje:
include ':common'
Oraz w gradle.build dodaje zależność:
dependencies {
compile project(':common')
}
No ale niestety to nie działa, dostaje taki error:
Could not determine the dependencies of task ':compileJava'.
Could not resolve all task dependencies for configuration ':compileClasspath'.
Could not resolve project :common.
Required by:
project :
> Unable to find a matching configuration of project :common:
- None of the consumable configurations have attributes.
Próbowałem już chyba wszystkiego i straciłem na to prawie cały dzień.. Jeśli ktoś z was ma skonfigurowane submoduły dla springa i korzysta z commons w serwsiach, byłbym naprawdę wdzięczny za wskazówki.