MySQL driver dependency keeps disappearing from build.gradle

Hello everyone,

I’ve recently started working with the Apache Doris database and therefore need to use a MySQL driver. I’m currently adding the following dependency:

implementation 'com.mysql:mysql-connector-j:9.5.0'

The issue is the following:

  • I add the dependency to build.gradle
  • I sync Gradle
  • The project starts and works correctly
  • After stopping the application and either syncing Gradle again or restarting the project, the dependency disappears from build.gradle

As a result, the parts of the application that connect to Doris stop working because the driver is no longer present.

I suspect something in the Jmix tooling or Gradle integration may be overwriting the file. Has anyone experienced something similar or knows what could be causing this?

Environment:

  • Jmix version: 2.7.0
  • IntelliJ IDEA 2025.2.4 (Community Edition)
  • SDK: Eclipse Temurin 21.0.8

Hi @alex.maranduca

I had the same problem in the past with dependencies in the build.gradle

repositories {

   ...

    maven {
        url = 'https://repo.osgeo.org/repository/release'
    }
    // Dependencies for coordinates conversion
    //maven {
    //    url 'https://repo.osgeo.org/repository/release'
    //}
}

For this reason, I copied the same driver with a comment. This way, if it gets removed again, I can easily restore it.

In version 2.7.4, I no longer observe this behavior. Therefore, it might be simplest to upgrade from 2.7.0 to 2.7.4 (and Java to 21.0.10 :wink:).

Do you think this is feasible?

Regards
Felix

Hi,

Thank you for your feedback.

I can confirm that Studio removes manually added JDBC driver dependencies. However, in my case, it happens after modifying the datastore configuration, not after a Gradle import.

In any case, this is clearly a Studio defect and it will be fixed in the next release.