There is a multi-module project where module A compiles without relying on module B. When debugging module A, the evaluation expression has an error when the class of module B, to solve this problem, I added module B to the runtime classpath of module A. But when I test referencing module B's class in module A's code, it compiles, which means that module B is participating in module A's compilation classpath
// A/build.gradle
plugins {
id 'java-library'
id 'eclipse'
}
dependencies {
runtimeOnly project(':B')
}
Expected Behavior
Module B is only in the runtime classpath of Module A
Current Behavior
Module B appears in the compilation classpath and runtime classpath of module A
There is a multi-module project where
module A
compiles without relying onmodule B
. When debuggingmodule A
, the evaluation expression has an error when the class ofmodule B
, to solve this problem, I addedmodule B
to the runtime classpath ofmodule A
. But when I test referencingmodule B
's class inmodule A
's code, it compiles, which means thatmodule B
is participating inmodule A
's compilation classpathExpected Behavior
Module B is only in the runtime classpath of Module A
Current Behavior
Module B appears in the compilation classpath and runtime classpath of module A
Context
Steps to Reproduce
Your Environment