Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Milo 0.6.12 Gradle ambiguity error for guava 33 #1229

Closed
LocutusV0nB0rg opened this issue Feb 26, 2024 · 4 comments
Closed

Milo 0.6.12 Gradle ambiguity error for guava 33 #1229

LocutusV0nB0rg opened this issue Feb 26, 2024 · 4 comments

Comments

@LocutusV0nB0rg
Copy link
Contributor

Describe the bug
Updating my gradle dependency from api ('org.eclipse.milo:sdk-server:0.6.11') to api ('org.eclipse.milo:sdk-server:0.6.12') fails my gradle build with an ambiguity due to variants of the guava transitive dependency.

Expected behavior
Well... Gradle should keep building.

Logs and Packet Captures

Execution failed for task ':commons-dpi-opc:compileJava'.
> Could not resolve all files for configuration ':commons-dpi-opc:compileClasspath'.
   > Could not resolve com.google.guava:guava:33.0.0-jre.
     Required by:
         project :commons-dpi-opc > org.eclipse.milo:sdk-server:0.6.12 > org.eclipse.milo:stack-core:0.6.12
      > Cannot choose between the following variants of com.google.guava:guava:33.0.0-jre:
          - androidApiElements
          - jreApiElements
        All of them match the consumer attributes:
          - Variant 'androidApiElements' capabilities com.google.collections:google-collections:33.0.0-jre and com.google.guava:guava:33.0.0-jre:
              - Unmatched attributes:
                  - Found org.gradle.jvm.environment 'android' but wasn't required.
                  - Found org.gradle.status 'release' but wasn't required.
              - Compatible attributes:
                  - Required org.gradle.category 'library' and found compatible value 'library'.
                  - Required org.gradle.dependency.bundling 'external' and found compatible value 'external'.
                  - Required org.gradle.jvm.version '8' and found compatible value '8'.
                  - Required org.gradle.libraryelements 'classes' and found compatible value 'jar'.
                  - Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
          - Variant 'jreApiElements' capabilities com.google.collections:google-collections:33.0.0-jre and com.google.guava:guava:33.0.0-jre:
              - Unmatched attributes:
                  - Found org.gradle.jvm.environment 'standard-jvm' but wasn't required.
                  - Found org.gradle.status 'release' but wasn't required.
              - Compatible attributes:
                  - Required org.gradle.category 'library' and found compatible value 'library'.
                  - Required org.gradle.dependency.bundling 'external' and found compatible value 'external'.
                  - Required org.gradle.jvm.version '8' and found compatible value '8'.
                  - Required org.gradle.libraryelements 'classes' and found compatible value 'jar'.
                  - Required org.gradle.usage 'java-api' and found compatible value 'java-api'.

Additional context
Milo Version 0.6.12 is the Version where the guava version was updated. Perhaps milo has to specify the variant explicitly?

@kevinherron
Copy link
Contributor

I don't know what this means. I thought I already specified the variant explicitly with the -jre suffix on the version.

@kevinherron
Copy link
Contributor

@LocutusV0nB0rg
Copy link
Contributor Author

I tried overwriting the transitive depends of milo in my gradle project but had no success. However there is very little documentation of how to achieve this, so I am not suprised really... However I think this should be solved here.

@kevinherron
Copy link
Contributor

This doesn't look like something that would get fixed in Milo. Looks like a gradle problem, see some of the solutions here: google/guava#6612

Are you using a recent version of Gradle? Have you applied the java plugin to the project you're building this in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants