gmazzo
03/10/2025, 10:24 AMsinging
plugin to the project), we end up concluding the Plugin Portal
is somehow ignoring .asc
files, they are not there when requested by URL. Which is not the case for Maven Central's URL.
Does anyone knows if this an intentional behavior of Plugins Portal, or a bug?BenoƮt Liessens
03/11/2025, 6:25 PMclass QualityPlugin : Plugin<Project> {
override fun apply(target: Project) {
target.pluginManager.apply(DetektPlugin::class.java)
target.extensions.configure(DetektExtension::class.java) {
allRules = true
}
}
}
Now I have a project where I want to apply my QualityPlugin and, additionally, set a Detekt base line:
plugins {
id("my quality plugin name")
}
detekt {
baseline = file("config/detekt-baseline-test.xml")
}
I was expecting Gradle to graciously merge the allRules
and baseline
settings in the DetektExtension but alas. The baseline is ignored.
What am I doing wrong?
ThanksHarshjeet Patil
03/14/2025, 4:58 PMDenis Berestinsky
03/15/2025, 12:46 PMTransformAction
. There is a case when inputArtifact
for TransformAction
doesn't exist (But it has to be an output artifact of an another subproject). What's the proper way to handle this case? And what are the possible causes of it?Vampire
03/17/2025, 5:09 PMCircularReferenceException
in task ordering besides "just seeing the problem"?
I have a cycle and I have no idea where it comes from right now.Kelvin Chung
03/17/2025, 5:56 PMValueSource
, is there a serializability requirement on the parameters?
eg.
abstract class MyValueSource : ValueSource<String, MyValueSource.Parameters> {
interface Parameters : ValueSourceParameters {
val myClient: Property<MyClient>
}
}
vs.
abstract class MyValueSource : ValueSource<String, MyValueSource.Parameters> {
interface Parameters : ValueSourceParameters {
val myService: Property<MyService> // from a BuildService provider
val clientName: Property<String>
}
private val myClient = parameters.myService.zip(parameters.myClient) { ... }
}
I seem to recall that there being a case, but I want to make sure, since you can certainly design without.Ben Madore
03/18/2025, 1:34 PMmaven-publish
plugin, configuring publication. e.g.
val artifactName: Property<String> = project.objects.property(String::class.java)
used as
fooConventions {
artifactName = "my-artifact-name"
}
a few times weāve run into issues where someone copy-pastes some code and duplicates the artifact name, this unfortunately isnāt caught until the jar file is attempted to be published to artifactory, and user gets an unclear message that the artifact has already been published, and they tend to think itās a CI problem instead of a project problem.
What would be the most ideal way to validate that the configuration across all sub-projects does not contain any duplicates between each projectās conventions.artifactName
property? Is this a valid use of a Shared Build Service? I could do it simply at the top level project and reach down into the subprojects, but i think then itād have to be in an afterEvaluate
which, as i understand it, is detrimental to config caching.no
03/21/2025, 8:02 AM<https://storage.googleapis.com/r8-releases/>
. I would normally add an ivy repository from my Gradle plugin to do this but this doesn't work if the consuming project has
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
}
I could use a Gradle task to download the jar but then it wouldn't be cached like a dependency download is. Are there other alternatives here?Ben Bader
03/21/2025, 3:25 PMjava.nio.file.Path
into a FileTreeElement
? The paths are not guaranteed to point to files within the Gradle project; my interest here is in using a PatternSet
to filter them, but the spec it creates only operates on FileTreeElement
instances.
Is such a thing even possible with the public API?Slackbot
03/23/2025, 7:59 AMKarunakara NH
03/25/2025, 7:37 AMLebomodiko
03/25/2025, 9:01 AMClayton Walker
03/26/2025, 4:18 PMextension {
version = configuraitons.oneOfThem.incoming.platforms.matching("spring-boot-dependencies").versionOf("some-sub-dep")
}
That way I lazily retrieve a sub-version of a bomSergey Morgunov
03/26/2025, 5:36 PMcom.example.myplugin
Working version so far:
com.example.myplugin-java
com.example.myplugin-scala
But I donāt really like this mixing of separators šRTAkland
04/03/2025, 5:20 AMtarget.extensions.getByType(KotlinMultiplatformExtension::class.java)
.sourceSets.findByName(it.value.targetName)?.kotlin
?.srcDir("build/generated/kotlin/${it.value.targetName}")
but it not work, only commonMain sourceSet are be setSuhas Sharma
04/07/2025, 5:22 PMKevin Brightwell
04/10/2025, 8:06 PMdependencyProject
property anymore. What is the Gradle 9 way to do this?Adam
04/11/2025, 10:12 AMincludeBuild
the directory in our settings script
This works fine, however, I want to add all these plugins to the project classpath as such by adding them to the root project build script
plugins {
alias(libs.plugins.internal.company.plugin) apply false
alias(libs.plugins.internal.company.otherPlugin) apply false
// etc
}
When I do this, it works fine until I include the build for local iteration. I basically canāt sync because of the following error Error resolving plugin [id: 'plugin.name', version: '1.0.43'] > The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so compatibility cannot be checked.
Iām guessing this happens because when I include the build, gradle seems to add the plugins in it to the classpath with an unknown
version, but then also tries to grab the latest published versions since Iām also trying to add them to the classpath, thus creating a conflict. Is there any way to work around this or will I have to resort to just commenting out my plugins from the plugins
block whenever I want to work on them locally?Callum Rogers
04/14/2025, 2:12 PMConfiguration
with custom attributes a la https://docs.gradle.org/current/userguide/cross_project_publications.html#sec:variant-aware-sharing? Or is there some other way to safely read data from other projects?Claude Brisson
04/16/2025, 4:07 PMError resolving plugin [id: 'org.jetbrains.kotlin.multiplatform', version: '2.1.0', apply: false]
> The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so compatibility cannot be checked.
The error happens in my root build.gradle.kts, probably because of buildSrc dependencies. But buildSrc doesn't use the multiplatform plugin, so this is rather weird. Is there any way to know where the dependency with an unspecified version is coming from?Thomas Broyer
04/17/2025, 3:20 PMval myConf = configurations.create("conf")
/* eager configuration */
myConf.⦠= ā¦
tasks.register<MyTask>("myTask") {
someProp.from(myConf)
}
to
val myConfProvider = configurations.register("conf") {
/* lazy configuration */
⦠= ā¦
}
tasks.register<MyTask>("myTask") {
someProp.from(myConfProvider)
}
and
configurations["someConf"].extendsFrom(myConf)
to
configurations.named("someConf") { extendsFrom(myConfProvider.get()) }
?Kelvin Chung
04/18/2025, 6:50 PMplugins {
`version-catalog`
}
catalog {
versionCatalog {
version("my-project-version", version.toString())
}
}
Is it possible to somehow pass in a Provider
of some kind instead? This is is especially important if I use something like the Reckon plugin, which is causing CC issues because of this eager version resolution.Callum Rogers
04/22/2025, 3:15 PMConfiguration
? I really hoped something like
def sourceJars = configurations.register('sourceJars') {
extendsFrom otherConfiguration
attributes {
// but with the correct attribute
attribute LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, 'source-jar'
}
}
would just get me what I needed, rather than having to go through every jar then request the source jar using dependencies.createArtifactResolutionQuery()
for each main jar I find?Callum Rogers
04/23/2025, 2:01 PMGiuseppe Barbieri
04/25/2025, 11:55 AMClaude Brisson
04/28/2025, 4:19 AMorg.gradle.testfixtures.ProjectBuilder().build()
), and to other test-only modules.
Using the buildSrc
strategy or the includeBuild
strategy for the custom plugin module itself are not suitable for this plugin module since it does split the build configuration and make it much harder to mutualize configuration, resources, versions, etc. So I am expecting the custom module plugin to be a standard module among the others, in the same build unit. But the tests modules could be somehow separated, I guess.
What are the applicable build architectures for defining, testing and applying a custom plugin that would not isolate the custom plugin module in a separate build context, yet have the custom plugin be visible to tests modules, and to its own tests source code?Alexey Loubyansky
04/28/2025, 8:49 AMmyVariant
with the runtimeElements
as its base variant and add myAttribute
with myAttributeValue
to it. Then I create a configuration where I request myAttribute
with myAttributeValue
as the selection preference. However, I'm getting this error.
Caused by: org.gradle.internal.component.resolution.failure.exception.VariantSelectionByAttributesException: The consumer was configured to find attribute 'myAttribute' with value 'myAttributeValue'. However we cannot choose between the following variants of org.acme:lib-a:1.0-SNAPSHOT:
- myVariant
- runtimeElements
All of them match the consumer attributes:
- Variant 'myVariant' capability 'org.acme:lib-a:1.0-SNAPSHOT' declares attribute 'myAttribute' with value 'myAttributeValue':
- Unmatched attributes:
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
- Provides org.gradle.jvm.version '17' but the consumer didn't ask for it
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.status 'integration' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
- Variant 'runtimeElements' capability 'org.acme:lib-a:1.0-SNAPSHOT':
- Unmatched attributes:
- Doesn't say anything about myAttribute (required 'myAttributeValue')
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
- Provides org.gradle.jvm.version '17' but the consumer didn't ask for it
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.status 'integration' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
at org.gradle.internal.component.resolution.failure.describer.AmbiguousVariantsFailureDescriber.describeFailure(AmbiguousVariantsFailureDescriber.java:56)
at org.gradle.internal.component.resolution.failure.describer.AmbiguousVariantsFailureDescriber.describeFailure(AmbiguousVariantsFailureDescriber.java:39)
at org.gradle.internal.component.resolution.failure.ResolutionFailureHandler.lambda$describeFailure$3(ResolutionFailureHandler.java:275)
at org.gradle.internal.component.resolution.failure.ResolutionFailureHandler.describeFailure(ResolutionFailureHandler.java:275)
at org.gradle.internal.component.resolution.failure.ResolutionFailureHandler.ambiguousVariantsFailure(ResolutionFailureHandler.java:149)
at org.gradle.internal.component.model.GraphVariantSelector.selectByAttributeMatchingLenient(GraphVariantSelector.java:155)
at org.gradle.internal.component.model.GraphVariantSelector.selectByAttributeMatching(GraphVariantSelector.java:82)
at org.gradle.internal.component.model.LocalComponentDependencyMetadata.selectVariants(LocalComponentDependencyMetadata.java:110)
at org.gradle.internal.component.model.DelegatingDependencyMetadata.selectVariants(DelegatingDependencyMetadata.java:46)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.calculateTargetNodes(EdgeState.java:257)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.attachToTargetNodes(EdgeState.java:148)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.attachToTargetRevisionsSerially(DependencyGraphBuilder.java:390)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.resolveEdges(DependencyGraphBuilder.java:280)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:205)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:164)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphResolver.resolve(DependencyGraphResolver.java:120)
at org.gradle.api.internal.artifacts.ivyservice.ResolutionExecutor.doResolve(ResolutionExecutor.java:482)
at org.gradle.api.internal.artifacts.ivyservice.ResolutionExecutor.resolveGraph(ResolutionExecutor.java:355)
at org.gradle.api.internal.artifacts.ivyservice.ShortCircuitingResolutionExecutor.resolveGraph(ShortCircuitingResolutionExecutor.java:92)
at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolveGraph(DefaultConfigurationResolver.java:129)
I expected myVariant
to be the candidate with the "longest" match. I must be missing something. Why is this not the case? Thanks.Jonathing
04/29/2025, 5:25 PMdependencyResolutionManagement { repositories }
works? Or can someone explain it to me if it isn't documented? I understand that it is currently incubating.
As far as I've been able to tell, using it makes the project's own repositories immutable, but that's all I think I understand about it. I do my version catalog management in the settings.gradle
file, so I'll take any chances to keep as many things related to dependency management in that file as possible.Jonathing
04/29/2025, 6:14 PMgradle-plugin-development
plugin, to only use the Gradle API it offers? Here's a screenshot of my dependencies. IntelliJ is still including my Gradle wrapper's API files in the compile classpath.
I should mention that I'm also applying dev.gradleplugins.groovy-gradle-plugin
to the project's plugins.Philip W
04/30/2025, 8:36 AM