Slackbot
02/17/2023, 10:52 PMVampire
02/17/2023, 10:56 PMisTransitive = false
on the configuration or the dependency just gets you the dependency but no transitivesCristianGM
02/17/2023, 11:11 PMVampire
02/17/2023, 11:11 PMCristianGM
02/17/2023, 11:11 PMarchives
would probably do what I need but is not using variant selection (I mean, no attributes, it's legacy)Vampire
02/17/2023, 11:12 PMisTransitive = false
is what you are afterVampire
02/17/2023, 11:13 PMtransitive = false
if you are old-school (using Groovy DSL 😄)CristianGM
02/17/2023, 11:13 PM* What went wrong:
Could not determine the dependencies of task ':consumercompileJava'.
> Could not resolve all dependencies for configuration 'consumercompileClasspath'.
> Cannot change dependencies of dependency configuration 'producerapi' after it has been included in dependency resolution.
CristianGM
02/17/2023, 11:14 PMval jarOnly: Configuration by configurations.creating {
isCanBeConsumed = false
isCanBeResolved = true
isTransitive=false
}
dependencies {
jarOnly(project(":producer"))
implementation(project(":producer"))
}
Vampire
02/17/2023, 11:14 PMisTransitive = false
should cause thatVampire
02/17/2023, 11:15 PMjarOnly(...)
is available 🙂CristianGM
02/17/2023, 11:17 PMCristianGM
02/17/2023, 11:30 PMdependencies {
jarOnly(project(":produces:common")) {
isTransitive = false
}
implementation(project(":produces:common"))
}
CristianGM
02/17/2023, 11:31 PMVampire
02/17/2023, 11:34 PMisTransitive
on the configuration? Then having it on the dependency too ist just redundant. 😄CristianGM
02/17/2023, 11:35 PMVampire
02/17/2023, 11:36 PMisTransitive
on both, dependencies and configurations successfully in the past, so I can just guess that it is something else going wrong in your setup, but I cannot imagine what.Vampire
02/17/2023, 11:37 PMjarOnly
at configuration time and after it is resolved you try to add something to api
in producer, then I think you would get that error.CristianGM
02/17/2023, 11:37 PMtasks.withType<Jar>().configureEach {
from(jarOnly.map { zipTree(it) })
}
CristianGM
02/17/2023, 11:38 PMCristianGM
02/17/2023, 11:39 PMVampire
02/17/2023, 11:39 PMJar
tasks.Vampire
02/17/2023, 11:40 PMzipTree
.
That would also allow for the unzipped result to be reused if up to date.CristianGM
02/17/2023, 11:43 PM