How do I run Model Validations?
Model Validations can be used and run in multiple ways:
- CLI
- Jenkins
- Maven Plugin
- Micro RadiantMicro Radiant (MicroRadiant). The graphical modeling IDE and tooling environment used to design, edit, and maintain NS applications and project models.
There are several ways to run the model-validations:
- Maven
- µRadiant
- CLI
- Jenkins
You can run the validations with the expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact.-maven-plugin (version 2022.0.1 and up):
mvn -f pom-expand.xml expanders:validate-model -Dvalidation.html=report.html -Dvalidation.junit=report.xml -Dvalidation.print=true
You can also configure the plugin in the pom-expand.xml:
<plugin>
<groupId>net.democritus.maven.plugins</groupId>
<artifactId>expanders-maven-plugin</artifactId>
<version>${expandersPluginProject.version}</version>
<configuration>
<htmlReport>report.html</htmlReport>
<junitReport>report.xml</junitReport>
</configuration>
</plugin>
If any rule with priority error fails, the validate-model goal will fail.
This is to stop builds of invalid projects, since these issues will probably cause expansion or compilation errors down the line.
This can be disabled by passing the argument -Dvalidation.failIfError=false.
Since µRadiant version 1.8.0, the validations run in the model editor. Validation Issues will be shown as badges on the tabs and in the tree view.
You can select the validations tab to list all issues for an element.

You can also run the model-validations jar directly. The jar has a command line interface which can be used to run the validations:
mvn -U dependency:copy "-Dartifact=net.democritus.model:model-validations:RELEASE:jar:jar-with-dependencies" "-DoutputDirectory=." "-Dmdep.stripVersion=true" "-Dmdep.stripClassifier=true"
java -jar model-validations.jar --help
java -jar model-validations.jar \
--expansionSettings conf/expansionSettings.xml \
--stdout \
--html target/validation-report.html \
--junit target/validation-report.xml
Example stage in Jenkins.
stage('validate') {
steps {
modelValidations pomFile: 'pom-expansion.xml'
}
}