I have 2 project, the 1st project is depending on javassist
and 2nd project is dependint on the 1st and spring-boot-starter-thymeleaf.
The build gradle is like below 1st project
plugins {
id 'org.springframework.boot' version '2.3.3.RELEASE'
id 'java'
}
group 'org.example'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
implementation 'org.javassist:javassist:3.27.0-GA'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
The 2nd project is like below, :bar:hoge
is the 1st project.
plugins {
id 'org.springframework.boot' version '2.3.3.RELEASE'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'java'
}
group 'org.example'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
implementation project(':bar:hoge')
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
bootJar {
mainClassName = 'com.example.koji.Main'
}
If I run the ../gradlew dependencyInsight --dependency javassist --configuration runtimeClasspath
, The result is like below.
No dependencies matching given input were found in configuration ':foo:bar:runtimeClasspath'
And gradlew assemble
doesn't have javassist.
But If I removed id 'org.springframework.boot' version '2.3.3.RELEASE'
from 1st project or implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
from 2nd project, then same command will return like below
org.javassist:javassist:3.27.0-GA
\--- project :bar:hoge
\--- runtimeClasspath
And gradlew assemble
jar has javassist.
Any ideas? Now I need to add javassist dependency at 2nd project explicitly to solve it. Working project https://github.com/kojilin/example-multi