Lex Manos
04/18/2026, 10:08 PMconfigurations { api { transtive = false } }
Publishing non-transitive configuration 'apiElements'. This behavior has been deprecated. This will fail with an error in Gradle 10. Setting 'transitive = false' at the configuration level is ignored by publishing. Consider using 'transitive = false' on each dependency if this needs to be published.
Is there a good way to configure every dependency as transitive without literally adding { transitive = false } to every dependency line?
I have a task that generates files used during dev/compile. Added to sourceSets.main.java.srcDir files('src/main/generated')
Which now throws a implicit dependency issue on a bunch of tasks.
Is there any simpler way then adding 20 tasks.named(sourceSets.main.getCompileTaskName('java')).configure { t -> t.mustRunAfter(generate) } lines? Note I don't want to make generate run every invocation of gradle. Hence mustRunAfter and not dependeOn. The generated files are checked into our vcs so they don't need to be generated every run. But also tested sourceSets.main.java.srcDir generate.flatMap { it.output } and didn't change anything.Vampire
04/18/2026, 10:36 PMIs there a good way to configure every dependency as transitive without literally addingMaybe you can do it into every dependency line?{ transitive = false }
withDependencies of that configuration?
No idea.
But it might anyway be very questionable to do so even explicitly.
Which now throws a implicit dependency issue on a bunch of tasks.If you ask me, committing generated files is horribly wrong. You should never check in files that are build artifacts. But if you must do so, just don't run the
generate task together with the other tasks. Just call it on its own when you want to re-generate. The detection (at least currently) should not find the problem as long as you don't run the task in the same execution.Vampire
04/18/2026, 10:37 PMdependsOn would be a bad idea anyway. You would just do sourceSets.main.java.srcDir(generate) and thus every task that needs source automatically has the necessary dependency. The suggestions by that finding are pure symptom treatment you should usually avoid and fix the real problem instead.Lex Manos
04/18/2026, 11:14 PMMaybe you can do it inNaw anything I've tried results inof that configuration?withDependencies
Mutating dependency after it has been finalized has been deprecated.
It seems that dependencies are finalized before they are realized for any of the functions in DependencySet
You should never check in files that are build artifacts.waves hand Minecraft. When you see me ask fundamentally stupid things like this, know its because we are working on Minecraft related things.
This doesn't work. Okay so as long as I don't execute the generate task, and any task that consumes the generated stuff in the same invocation. Then it should be fine. I'll just manually add these 'mustRunAfter' stuff to shut up the errors during my hackysourceSets.main.java.srcDir(generate)
all task im using to do bulk configuration/build cache testing. Would be nice if there was a simpler way to test this.Luke Bemish
04/20/2026, 5:41 PMwithDependencies should be able to do this, I would think, if you instead copy the dependency and mutate the copy, clear the dependency set, and add the copies.Luke Bemish
04/20/2026, 5:44 PMwithDependencies shouldn't matter. In that case I think your best bet is to not publish apiElements but instead some other configuration, in which you have addAllLater the dependencies of apiElements, copied to make them non-transitive