Slackbot
06/23/2023, 3:55 PMephemient
06/23/2023, 4:00 PMbuildscript {
dependencies {
constraints {
classpath(...)
to workVampire
06/23/2023, 4:02 PMM3
06/23/2023, 4:38 PMconstraints did not work on dependencies pulled in by the plugins (works fine for normal dependencies, but if it is coming from a plugin, it seems to be ignoredVampire
06/23/2023, 4:39 PMVampire
06/23/2023, 4:40 PMM3
06/23/2023, 4:44 PMM3
06/23/2023, 4:46 PMsettings.gradle's pluginManagement section, but it refused to recognize the constraints directiveephemient
06/23/2023, 4:49 PMsettings.gradle, try
gradle.beforeProject {
buildScript {
...Vampire
06/23/2023, 4:52 PMbuildscript { ... } there should also workephemient
06/23/2023, 4:52 PMVampire
06/23/2023, 4:52 PMgradle.allprojects { ... } and gradle.beforeProject { ... } when called from a settings script?ephemient
06/23/2023, 4:53 PMallprojects runsVampire
06/23/2023, 4:54 PMephemient
06/23/2023, 4:54 PMM3
06/23/2023, 4:54 PMbuildScript - I thought this is some legacy statement (a lot of instructions mentioning say to use it only with older gradle) , but I starting to think I am wrongVampire
06/23/2023, 4:55 PMM3
06/23/2023, 4:55 PMVampire
06/23/2023, 4:55 PMVampire
06/23/2023, 4:55 PMplugins { ... } block.Vampire
06/23/2023, 4:56 PMVampire
06/23/2023, 4:56 PMephemient
06/23/2023, 4:57 PMM3
06/23/2023, 4:58 PM// in build.gradle
buildScript {
dependencies {
constraints {
...
}
}
}M3
06/23/2023, 4:58 PMVampire
06/23/2023, 4:58 PMephemient
06/23/2023, 4:58 PMVampire
06/23/2023, 4:59 PMVampire
06/23/2023, 4:59 PMbuildscript { ... } not buildscriptHierarchy { ... } 😄Vampire
06/23/2023, 4:59 PMephemient
06/23/2023, 5:00 PMbuildscript { dependencies { classpath(...) } } is inherited by child subprojectsM3
06/23/2023, 5:00 PMVampire
06/23/2023, 5:31 PMOnly kind of. It is not really inherited. It only works on the classpath of the current build script. This classpath lands on a class loader. This class loader is the parent of the class loader of the child project buildscript class loader. And as class loaders first have to ask their parent for a class before serving it themselves, the one would win. But on the class loader of the child project you could still have the a different version, maybe with vulnerabilities and so on. 🙂is inherited by child subprojectsbuildscript { dependencies { classpath(...) } }
ephemient
06/23/2023, 5:47 PMephemient
06/23/2023, 5:50 PMephemient
06/23/2023, 5:51 PM:buildEnvironment doesn't match what's actually on the classpath thoughVampire
06/23/2023, 5:51 PMephemient
06/23/2023, 5:54 PM