Customizing project templates (in terms of gradle)

Could it be possible to put e.g. repository configuration for dependency resolution and publishing into seperate files and make the use of the gradle wrapper optional?

This is why. We are developing in a network environment which is not connected to the internet. After creating projects with the Jmix wizards lots of errors encounter because we have to make a certain amount of changes.

The gradle wrapper script created by the wizard tries to download a gradle instance from the internet. We are using a local gradle installation (currently 7.3.3) and need to specify using that installation manually.

For build script resolution we have to add a section to the settings.gradle file:

pluginManagement {
  repositories {
    mavenLocal()
    maven {
      /* proxy gradle plugin repository */
      url 'https://nexus.company.com/content/repositories/gradle-plugins'
    }
  }
}

For code artifact dependency resolution we are using a repository proxy application for maven central and the jmix repository:

repositories {
  mavenLocal()
  maven {
    url 'https://maven.company.com'
  }
  maven {
    /* proxy maven central */
    url 'https://nexus.company.com/content/repositories/central'
    content {
      excludeGroupByRegex "com\\.company.*"
    }
  }
  maven {
    /* proxy jmix repositories */
    url 'https://nexus.company.com/content/repositories/jmix'
    content {
      excludeGroupByRegex "com\\.company.*"
    }
  }
}

Could it be possible to introduce something that saves us doing the for every single project.

This is also a task when downloading sample projects to reproduce issues or trying suggested example code.

You can create and use your own set of templates published on your own artifact repository.

Studio loads the list of templates from the first repository in the list which has the io.jmix.templates.studio:jmix-studio-templates artefact. Normally it’s a set of templates built by us from the https://github.com/Haulmont/jmix-templates repo for each Jmix release. But you can clone this repo, add your own templates and publish them to your private artefact repository.

For example:

cd jmix-templates
./gradlew publish -PjmixUploadUrl=http://localhost:8081/repository/maven-snapshots/ -PjmixUploadUser=admin -PjmixUploadPassword=admin

Then when creating a new project in Studio, select a custom configuration and add your repository to the start of the list, for example:
image

After that, you should see your templates on the next step of the wizard. If not, restart the IDE once (your repository will remain in the list).

Ok, I will think about that. Two considerations about that…

  1. Will still have to synchronize changes on your original templates on each release
  2. If we might commit and push some projects to a (more) public source code repository and want to invite developers who are developing in another (regular Internet environment), this approach does not work straight forward

Your concerns are absolutely valid.

We’ve recently filed an issue for improvement in this area: Ability to create custom project template : JST-2553. Will try to do it in the next feature release.

3 Likes

@krivopustov After some time, I tried to implement such studio custom templates.

I published the customized variant (based on release_2_7) to my local maven repository.

Then I tried to test it by creating a new Jmix project and checked Use local Maven repository.
jmix-studio-templates_local-maven

But it seems to be ignored for template lookup?
(How) can I debug the use of template lookups?

Edit: I tried it with IntelliJ IDEA 2025.3.4 with Jmix Plugin version 2.7.3-253

Hi Steffen,

After publishing templates into local Maven repo, exit the IDE, then remove the following folders:

See also Custom Project Templates :: Jmix Documentation

Regards,
Konstantin

@krivopustov Thank you for linking the documentation I missed.

I tried to do so, but I am still not getting the custom built templates found.

To test the lookup, I opened the New Project dialog, switched to custom configuration, unchecked all network repositories and checked local repository only. After doing so, the available versions disappear and an error notification is shown.
The idea.log excerpt during these actions reads:

2026-03-24 13:22:25,718 [  25806]   INFO - #com.haulmont.jmixstudio.backend.template.JmixRemoteArtifactsManager - Start loading list of remote artifacts
2026-03-24 13:22:25,719 [  25807]   INFO - #com.haulmont.jmixstudio.backend.maven.RemoteMavenRepository - Loading artifacts list from https://global.repo.jmix.io/repository/public
2026-03-24 13:22:25,720 [  25808]   INFO - #com.haulmont.jmixstudio.backend.maven.RemoteMavenRepository - [external_req] Load file content https://global.repo.jmix.io/repository/public/com/layertec/lib/jmix/jmix-studio-templates/maven-m
etadata.xml
2026-03-24 13:22:25,880 [  25968]   INFO - #com.haulmont.jmixstudio.backend.template.JmixRemoteArtifactsManager - Start loading list of remote artifacts
2026-03-24 13:22:25,880 [  25968]   INFO - #com.haulmont.jmixstudio.backend.maven.RemoteMavenRepository - Loading artifacts list from https://global.repo.jmix.io/repository/public
2026-03-24 13:22:25,880 [  25968]   INFO - #com.haulmont.jmixstudio.backend.maven.RemoteMavenRepository - [external_req] Load file content https://global.repo.jmix.io/repository/public/io/jmix/templates/studio/jmix-studio-templates/mave
n-metadata.xml
2026-03-24 13:22:28,082 [  28170]   INFO - #com.haulmont.jmixstudio.backend.template.JmixRemoteArtifactsManager - Start loading list of remote artifacts
2026-03-24 13:22:28,082 [  28170]   INFO - #com.haulmont.jmixstudio.backend.maven.RemoteMavenRepository - Loading artifacts list from file:///home/bank/.m2/repository/
2026-03-24 13:22:28,082 [  28170]   INFO - #com.haulmont.jmixstudio.backend.maven.RemoteMavenRepository - [external_req] Load file content file:///home/bank/.m2/repository/com/layertec/lib/jmix/jmix-studio-templates/maven-metadata-local
.xml
2026-03-24 13:22:28,082 [  28170]   INFO - #com.haulmont.jmixstudio.backend.template.JmixRemoteArtifactsManager - Start loading list of remote artifacts
2026-03-24 13:22:28,083 [  28171]   INFO - #com.haulmont.jmixstudio.backend.maven.RemoteMavenRepository - Loading artifacts list from https://global.repo.jmix.io/repository/public
2026-03-24 13:22:28,083 [  28171]   INFO - #com.haulmont.jmixstudio.backend.maven.RemoteMavenRepository - [external_req] Load file content https://global.repo.jmix.io/repository/public/com/layertec/lib/jmix/jmix-studio-templates/maven-m
etadata.xml
2026-03-24 13:22:28,175 [  28263]   INFO - #com.haulmont.jmixstudio.backend.template.JmixRemoteArtifactsManager - Start loading list of remote artifacts
2026-03-24 13:22:28,175 [  28263]   INFO - #com.haulmont.jmixstudio.backend.maven.RemoteMavenRepository - Loading artifacts list from file:///home/bank/.m2/repository/
2026-03-24 13:22:28,175 [  28263]   INFO - #com.haulmont.jmixstudio.backend.maven.RemoteMavenRepository - [external_req] Load file content file:///home/bank/.m2/repository/io/jmix/templates/studio/jmix-studio-templates/maven-metadata-lo
cal.xml
2026-03-24 13:22:31,227 [  31315]   INFO - #com.haulmont.jmixstudio.backend.template.JmixRemoteArtifactsManager - Start loading list of remote artifacts
2026-03-24 13:22:31,227 [  31315]   INFO - #com.haulmont.jmixstudio.backend.maven.RemoteMavenRepository - Loading artifacts list from file:///home/bank/.m2/repository/
2026-03-24 13:22:31,227 [  31315]   INFO - #com.haulmont.jmixstudio.backend.template.JmixRemoteArtifactsManager - Start loading list of remote artifacts
2026-03-24 13:22:31,227 [  31315]   INFO - #com.haulmont.jmixstudio.backend.maven.RemoteMavenRepository - Loading artifacts list from https://global.repo.jmix.io/repository/public
2026-03-24 13:22:31,227 [  31315]   INFO - #com.haulmont.jmixstudio.backend.maven.RemoteMavenRepository - [external_req] Load file content https://global.repo.jmix.io/repository/public/com/layertec/lib/jmix/jmix-studio-templates/maven-metadata.xml
2026-03-24 13:22:31,324 [  31412]   INFO - #com.haulmont.jmixstudio.backend.template.JmixRemoteArtifactsManager - Start loading list of remote artifacts
2026-03-24 13:22:31,324 [  31412]   INFO - #com.haulmont.jmixstudio.backend.maven.RemoteMavenRepository - Loading artifacts list from file:///home/bank/.m2/repository/
2026-03-24 13:22:32,547 [  32635]   INFO - #com.haulmont.jmixstudio.backend.template.JmixRemoteArtifactsManager - Start loading list of remote artifacts
2026-03-24 13:22:32,547 [  32635]   INFO - #com.haulmont.jmixstudio.backend.maven.RemoteMavenRepository - Loading artifacts list from file:///home/bank/.m2/repository/
2026-03-24 13:22:32,555 [  32643]   INFO - #com.haulmont.jmixstudio.backend.template.JmixRemoteArtifactsManager - Start loading list of remote artifacts
2026-03-24 13:22:32,555 [  32643]   INFO - #com.haulmont.jmixstudio.backend.maven.RemoteMavenRepository - Loading artifacts list from file:///home/bank/.m2/repository/
2026-03-24 13:22:32,689 [  32777]   WARN - #com.haulmont.jmixstudio.backend.notifydialog.JmixNotificationsManager - Unable to find supported Jmix versions with provided conditions
java.lang.IllegalStateException: Unable to find supported Jmix versions with provided conditions
        at com.haulmont.jmixstudio.backend.notifydialog.JmixNotificationsManager.errorReport(JmixNotificationsManager.java:215)
        at com.haulmont.jmixstudio.backend.notifydialog.JmixNotificationsManager.errorReport(JmixNotificationsManager.java:206)
        at com.haulmont.jmixstudio.intellij.ui.pm.platformVersion.ui.impl.select.VersionSelectorComponents.update(VersionSelectorComponents.kt:183)
        at com.haulmont.jmixstudio.intellij.ui.pm.platformVersion.ui.impl.select.VersionSelectorComponents.updatePlatformVersionField$lambda$1$0(VersionSelectorComponents.kt:166)
        at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:239)
...

I also tried to remove the custom project templates and keep the templates as similar as possible and changed the minimum for a “non-direct-internet-connection environment”:

  • on build.gradle files I replaced the still hard coded gradlePluginPortal() and mavenCentral() by nexus proxied ones
  • replace the distributionUrl on each gradle/wrapper/gradle-wrapper.properties
  • adding a nexus proxied gradle-plugin repository on settings.gradle.kts

I tried to compare the content of the jmix-studio-templates-2.7.6.jar files (the cached Jmix templates downloaded and the own built ones). The only difference are the files mentioned above.

Can I debug more into detail? What is the Jmix studio plugin looking for?