Hi All,
I have problem with composite build. I fall to issues when I migrate gradle project from 4.5 to 5.0. For demonstrating my problem I create empty project. Project contains two module first is gb2pp and second micu-commands. micu-commands has dependency to gb2pp.
/gb2pp
β setings.gradle
rootProject.name = 'micu-commands'
/gb2pp
β build.gradle
buildscript {
ext {
springBootVersion = '2.1.0.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'cz.netsystem.micu'
version = '0.1.2'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
implementation('org.springframework.boot:spring-boot-starter')
runtimeOnly('org.springframework.boot:spring-boot-devtools')
testImplementation('org.springframework.boot:spring-boot-starter-test')
}
/micu-commands
β settings.gradle
rootProject.name = 'micu-commands'
includeBuild '../gb2pp'
/micu-commands
β build.gradle
buildscript {
ext {
springBootVersion = '2.1.0.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'cz.netsystem.micu'
version = '0.1.2'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
implementation('org.springframework.boot:spring-boot-starter')
implementation('cz.netsystem.micu:gb2pp')
runtimeOnly('org.springframework.boot:spring-boot-devtools')
testImplementation('org.springframework.boot:spring-boot-starter-test')
}
The code you can find on github repository:
When I try to run application from IntelliJ itβs run without problem, but when I try to build it from command line I get error that package from gb2pp module does not exist.
ERROR:
gradle build
> Task :compileJava FAILED
/home/bliker/Dokumenty/micu/micu/micu-commands/src/main/java/cz/netsystem/micu/micucommands/sche/TestScheduler.java:3: error: package cz.netsystem.micu.gb2pp.domain does not exist
import cz.netsystem.micu.gb2pp.domain.User;
^
/home/bliker/Dokumenty/micu/micu/micu-commands/src/main/java/cz/netsystem/micu/micucommands/sche/TestScheduler.java:12: error: cannot find symbol
User user = new User();
^
symbol: class User
location: class TestScheduler
/home/bliker/Dokumenty/micu/micu/micu-commands/src/main/java/cz/netsystem/micu/micucommands/sche/TestScheduler.java:12: error: cannot find symbol
User user = new User();
^
symbol: class User
location: class TestScheduler
3 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
1 actionable task: 1 executed
I will appropriate any help. Can anyone help me please, Iβm totally stack.
Thank you,
Martin