How-to use the platform to streamline modelix dependencies

General Usage

The modelix platform provides component versions. To enforce these versions in your project’s build you can add the platform as an enforcedPlatform. We assume that the string variable modelix_platform_version contains the version of the modelix platform you want to use, e. g. 24.1.0

To enforce the versions provided by the platform in your Gradle build, you can use enforcedPlatform inside of a dependencies block like this:

dependencies {
    implementation(enforcedPlatform("org.modelix:platform:$modelix_platform_version"))
}

Dependencies to modelix components can then be declared without a version number (as the version declared in the platform will be used). For example:

dependencies {
    implementation(enforcedPlatform("org.modelix:platform:$modelix_platform_version"))
    implementation("org.modelix:model-client")
}

Overriding versions

Overriding versions may lead to incompatibilities between individual modelix components.

In order to override versions inside the platform during dependency resolution, platform can be used instead of enforcedPlatform:

dependencies {
    implementation(platform("org.modelix:platform:$modelix_platform_version"))
    implementation("org.modelix:model-client:2.4.0")
}
If you want to learn more about the difference between platform and enforcedPlatform, you can check out this section in the Gradle documentation.