Midpoint Studio switch to Gradle

Last modified 25 Oct 2022 13:52 +02:00


Currently, projects created and managed by Midpoint Studio use Maven as dependency management tool. This helps Idea and Studio plugin to support functionality directly dependent on Midpoint code base (e.g. code completions, XSD schema validation)

There are three main problems with current state:

  1. If user has multiple Midpoint environments configured and these use different versions of Midpoint, plugin features might be a little off in some cases. Mainly groovy scripts code validation with code autocompletion. Also XSD schema validation might throw errors about unknown elements, or missing elements in XMLs.

  2. Upgrading dependencies in Midpoint project is now very cumbersome. Maven POM file has to be edited, too many properties changed, dependencies updated.

  3. If there’s new feature added to Studio plugin which requires new Maven dependency on classpath to function properly or other changes on Maven level, each user must update POM file accordingly and this also depends on specific set of Midpoint dependencies.

Example of Maven pom.xml file created by Studio plugin (not maintained in any way afterwards):

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">








        <!-- TEST -->

In here ${UPPER_CASE} properties are replaced when Midpoint project is created in Intellij Idea. Updating this is a nightmare even for Midpoint devs - if you want to stay up to date with the dependencies.


New proposition is simple, we’ll switch to from Maven to Gradle as backbone for dependencies management in Midpoint project.

Gradle is much more flexible with more options to customize how dependencies are loaded an handled. API to develop plugins is on different level compared to Maven.

Gradle build would be supported by custom Gradle plugin for Midpoint project developed hand in hand with Studio plugin.

Example of proposed Gradle file (in kotlin)

plugins {
    id("com.evolveum.midpoint.studio") version "1.0-SNAPSHOT" // this is Gradle plugin version, not Intellij Studio plugin

group = "org.example.midpoint.project"
version = "0.1"

midpointStudio {
    midpointVersion = "4.5"

As you can see to update version of Midpoint, user has to change one value, which refers to Midpoint version. Dependencies changes will be handled accordingly via new Midpoint gradle plugin.

As usual there has to be an option to support for custom dependencies, e.g. custom libs or overlay build.

In first iteration, gradle plugin would set up:

  • java plugin

  • list of midpoint related dependencies

  • list of repositories (evolveum nexus)

  • …​other ideas welcomed

Was this page helpful?
Thanks for your feedback