The MPS Maven Plugin is used to generate code from JetBrains MPS models created using MPS language plugins for IntelliJ IDEA. The plugin does not require MPS to be installed on the machine and thus helps integrate MPS into Maven-based continuous integration builds.
The MPS Maven Plugin has a single goal, mps:generate-java.
The plugin requires MPS deployed in the form of artifacts to a Maven repository. These artifacts can be created and deployed from a local installation of MPS using MPS Maven Deployer.
Add the plugin to your pom.xml and configure dependencies on the artifacts deployed in step 1. For example:
<plugin> <groupId>org.jetbrains.mps</groupId> <artifactId>mps-maven-plugin</artifactId> <version>${mps-maven-plugin.version}</version> <executions> <execution> <goals> <goal>generate-java</goal> </goals> <configuration> <dependencies> <dependency> <groupId>org.jetbrains.mps</groupId> <artifactId>mps-modules</artifactId> <version>123.4567</version> <type>mar</type> </dependency> </dependencies> </configuration> </execution> </executions> </plugin>
Run mvn generate-sources (or any other Maven goal that includes generate-sources).