Trying to take advantage of java-library
plugin in its ability to share across subprojects via class directories, not using jars…
So I have something like:
top-proj
build.gradle
a-proj
build.gradle
b-proj
build.gradle
b-proj > build.gradle
has a dependency to a-proj defined
dependencies {
implementation project(':a-proj')
}
When I run :b-proj:classes
I see only a-proj:classes
running, not a-proj:jar
, so that looks good.
But I need to get the runtime classpath of b-proj written to a file so when I startup Jetty I can pass that in as the classpath. So I add a custom task to b-proj that writes sourceSets.main.runtimeClasspath.asPath
to a file.
When I do that it causes :b-proj:jar
to run.
Any idea how I can get the classpath to a file without Gradle thinking I need the jar built?
PS: The runtime classpath output in the file refers to a-proj by its classes directory , not the jar. All the more reason the jar isn’t needed.
Thanks,
Padraic