This is indeed how Mendix works. Unfortunately, Mendix does not support a more modern dependency manager such as Maven or Gradle.
A way to workaround this is to find or prepare a so called fat-jar. This is a jar that contains all transitive dependencies for a java library. Then you can include this in Mendix as a single jar file. Doing this with Gradle is very easy and requires just a few lines of configuration. Here is a minimal example that packages selenium and all its dependencies in a fat jar using gradle
plugins {
id 'com.github.johnrengelman.shadow' version '5.1.0'
id 'java'
}
repositories {
jcenter()
}
dependencies {
// https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.141.59'
}
4 . run gradle shadowJar
5 . under build/libs you will find the generated fat jar
For more details check out this blog post: https://www.notion.so/gajduk/Managing-java-dependencies-in-Mendix-modules-ca512fc52e444f06a2225e44fb638f84
-Andrej