Custom Project Templates
Studio supports custom artifacts containing project templates, so you can provide your own templates for new projects and UI screens.
To set the artifact coordinates, click Settings → Jmix Plugin Settings and enter the group and artifact name in the Additional templates artifact field. The artifact version must be the same as the Jmix BOM version used in the project templates of this artifact.
Studio looks for the standard templates artifact (io.jmix.templates.studio:jmix-studio-templates
) and the custom one in the repository selected in the New Project wizard. If both are found, it merges the templates giving the priority to the custom templates. It allows you to override a standard template by providing your own template in the same directory, for example, content/project/application
.
To build an artifact with custom templates, follow the steps below.
-
Clone the https://github.com/jmix-framework/jmix repository and copy its
jmix-templates
subdirectory to a different location on your computer. -
Change
group
property inbuild.gradle
, for example:group = 'com.company.templates'
-
Change
version
ingradle.properties
to the value of the desired Jmix BOM, for example:version = 1.5.0
-
Modify existing templates or add yours. For example, copy the
content/project/application
folder tomy-application
and change thename
andorder
properties in itstemplate.json
file:{ "version": 1, "name": "My Full-Stack Application", "order": 50, "addon": false,
-
Build the artifact and publish it to the local Maven repository:
./gradlew publishToMavenLocal
-
Click Settings → Jmix Plugin Settings and enter
com.company.templates:jmix-studio-templates
in the Additional templates artifact field. -
Remove the templates cache from the IDE configuration directory:
-
Find your IDE configuration directory as explained in the IntelliJ IDEA docs.
-
Remove everything from its
jmix/templates
subdirectory.
-
-
Create a new project and select Use local Maven repository checkbox. In the Jmix version dropdown, select the version of your custom artifact.
-
On the next step of the wizard, you should see the combined list of templates, including your custom template.