Java Dependency Conflict After Adding Community Commons and OPC UA Connector Modules

0
Hi all, I'm working on a new Mendix project and ran into a Java dependency issue after installing some Marketplace modules. Here's what happened: I started with a clean Mendix project. I first downloaded the Community Commons module (latest version). Then I added the OPC UA Connector module. After this, I noticed some unexpected behavior: The userlib folder became empty. The vendorlib folder disappeared completely. My Java build started failing, with Gradle errors related to Guava version conflicts (e.g., guava:33.4.7-jre, 30.1-jre, etc.). The error log includes messages like:   FAILURE: Build failed with an exception. * What went wrong:Execution failed for task ':copyDependencies'.> Could not resolve all files for configuration ':implementation'.   > Could not resolve com.google.guava:guava:33.4.7-jre.     Required by:         project :      > Cannot choose between the following variants of com.google.guava:guava:33.4.7-jre:          - androidRuntimeElements          - jreRuntimeElements        All of them match the consumer attributes:          - Variant 'androidRuntimeElements' capabilities com.google.collections:google-collections:33.4.7-jre and com.google.guava:guava:33.4.7-jre:              - 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.environment 'android' but the consumer didn't ask for it                  - Provides org.gradle.jvm.version '8' 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 'release' but the consumer didn't ask for it                  - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it          - Variant 'jreRuntimeElements' capabilities com.google.collections:google-collections:33.4.7-jre and com.google.guava:guava:33.4.7-jre:              - 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.environment 'standard-jvm' but the consumer didn't ask for it                  - Provides org.gradle.jvm.version '8' 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 'release' but the consumer didn't ask for it                  - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it   > Could not resolve com.google.guava:guava:30.1-jre.     Required by:         project : > com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20211018.2      > Cannot choose between the following variants of com.google.guava:guava:33.4.7-jre:          - androidRuntimeElements          - jreRuntimeElements        All of them match the consumer attributes:          - Variant 'androidRuntimeElements' capabilities com.google.collections:google-collections:33.4.7-jre and com.google.guava:guava:33.4.7-jre:              - 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.environment 'android' but the consumer didn't ask for it                  - Provides org.gradle.jvm.version '8' 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 'release' but the consumer didn't ask for it                  - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it          - Variant 'jreRuntimeElements' capabilities com.google.collections:google-collections:33.4.7-jre and com.google.guava:guava:33.4.7-jre:              - 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.environment 'standard-jvm' but the consumer didn't ask for it                  - Provides org.gradle.jvm.version '8' 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 'release' but the consumer didn't ask for it                  - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it   > Could not resolve com.google.guava:guava:33.0.0-jre.     Required by:         project : > org.eclipse.milo:sdk-client:0.6.12 > org.eclipse.milo:stack-client:0.6.12 > org.eclipse.milo:stack-core:0.6.12      > Cannot choose between the following variants of com.google.guava:guava:33.4.7-jre:          - androidRuntimeElements          - jreRuntimeElements        All of them match the consumer attributes:          - Variant 'androidRuntimeElements' capabilities com.google.collections:google-collections:33.4.7-jre and com.google.guava:guava:33.4.7-jre:              - 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.environment 'android' but the consumer didn't ask for it                  - Provides org.gradle.jvm.version '8' 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 'release' but the consumer didn't ask for it                  - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it          - Variant 'jreRuntimeElements' capabilities com.google.collections:google-collections:33.4.7-jre and com.google.guava:guava:33.4.7-jre:              - 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.environment 'standard-jvm' but the consumer didn't ask for it                  - Provides org.gradle.jvm.version '8' 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 'release' but the consumer didn't ask for it                  - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it * Try:> Run with --stacktrace option to get the stack trace.> Run with --info or --debug option to get more log output.> Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 1s
asked
2 answers
0

Hi Shivaji,

 

A quick but effective way to solve issues like this is to completely clear the userlib and vendorlib folders, and then re-import all the necessary Marketplace modules.

 

Keep in mind: if you've made changes to any Marketplace module, re-importing it will overwrite those changes. That’s why it's best practice not to modify Marketplace modules directly. Still, if changes were made, be sure to check for them before proceeding.

 

If there are changes in your marketplace modules that you want to keep, create a new dummy Mendix app and import all required Marketplace modules into it. Then, copy the userlib and vendorlib contents from the dummy app and paste them into the app you're trying to fix.

answered
0

Hi Tim Verlinde,

Thanks for the detailed explanation!

As suggested, I created a new Mendix application and imported both the Community Commons and OPC UA Connector modules from the Marketplace. I then copied the contents of the userlib and vendorlib folders from the new app into my original application.

However, even after doing this, I’m still encountering a Java dependency error during the build process. Do you have any suggestions on what else I could check or try to resolve this issue?

Appreciate your support!

 

answered