JetBrains / intellij-platform-gradle-plugin

Gradle plugin for building plugins for IntelliJ-based IDEs
https://plugins.jetbrains.com/docs/intellij/gradle-prerequisites.html
Apache License 2.0
1.42k stars 270 forks source link

Could not resolve io.github.pdvrieze.xmlutil:core:0.86.3 #1741

Open Vanco opened 4 weeks ago

Vanco commented 4 weeks ago

What happened?

My multi-module project is work on version 2.0.0 very well. but when I try to upgrade to 2.0.1,

  1. modifiy the version string from 2.0.0 to 2.0.1
  2. sync gradle.
  3. fail with error message.

Relevant log output or stack trace

Could not resolve all artifacts for configuration 'classpath'.
> Could not resolve io.github.pdvrieze.xmlutil:core:0.86.3.
  Required by:
      unspecified:unspecified:unspecified > org.jetbrains.intellij.platform.settings:org.jetbrains.intellij.platform.settings.gradle.plugin:2.0.1 > org.jetbrains.intellij.platform:intellij-platform-gradle-plugin:2.0.1 > io.github.pdvrieze.xmlutil:serialization-jvm:0.86.3
   > The consumer was configured to find a library for use during runtime, compatible with Java 21, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.9'. There are several available matching variants of io.github.pdvrieze.xmlutil:core:0.86.3
     The only attribute distinguishing these variants is 'org.jetbrains.kotlin.platform.type'. Add this attribute to the consumer's configuration to resolve the ambiguity:
       - Value: 'androidJvm' selects variant: 'androidRuntimeElements-published'
       - Value: 'jvm' selects variant: 'jvmRuntimeElements-published'

Steps to reproduce

  1. modifiy the version string from 2.0.0 to 2.0.1
  2. sync gradle.

Gradle IntelliJ Plugin version

2.0.1

Gradle version

8.9

Operating System

macOS

Link to build, i.e. failing GitHub Action job

No response

hsz commented 1 week ago

Do you regularly apply the plugin to the project or import it into a custom buildscript?

Vanco commented 1 week ago

I apply the plugin in build-logic project. I attached my project structure for reference. Before I upgrade to version 2.0.1, the old version is 2.0.0, everything work as expected.

when I change the version code to 2.0.1, (in /platforms/plutins-platform/build.gradle.kts), the project will fail in gradle configuration phase.

vssd-demo.zip

hsz commented 1 week ago

This issue is directly related to https://github.com/pdvrieze/xmlutil/issues/56 As one is using the plugin with no intermediate build-logic involved, my constraints seem to help Gradle pick the proper transitive dependency variant: https://github.com/JetBrains/intellij-platform-gradle-plugin/blob/62af3d16f9aa57cfc4df1c127a829a67a3f1e897/build.gradle.kts#L59-L65

However, this somehow gets lost in a custom build-logic setup.