Expansion Settings
Each NS project requires an expansionSettings.xml
. This file is the starting point of each each expansion.
It describes:
- where to find the model files
- where to generate the expanded artifacts
- which expanders (expansion-resources) to use
It is also useful to have a pom-expansion.xml
file.
This is a maven project file that includes the expanders-maven-plugin
, which is used to run the expansion.
project
├── pom-expansion.xml
├── conf
│ └── expansionSettings.xml
.
- expansionSettings.xml
- pom-expansion.xml
<expansionSettings>
<!-- modelDirectory is the root directory for the model files, i.e. where the applications and components directories can be found -->
<modelDirectory>..</modelDirectory>
<!-- expansionDirectory is the target directory where the expansion should place the generated files -->
<expansionDirectory>../expansions</expansionDirectory>
<expansions>
<!-- here you can define where the root of the model can be found, typically points towards an application -->
</expansions>
<expansionResources>
<!-- expansion resources are resources bundles that provide expanders, features etc.
If they are defined here, they will be fetched before expansion using maven and added to the classpath -->
<expansionResource name="net.democritus:nsx-default-stack" version="2024.16.6"/>
</expansionResources>
<settingsDirectories>
<!-- settings directories contain settings xml files. -->
<settingsDirectory>
<directory>../settings</directory>
</settingsDirectory>
</settingsDirectories>
</expansionSettings>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.normalizedsystems</groupId>
<artifactId>expansion</artifactId>
<version>1.0.0-SNAPSHOT</version>
<properties>
<expanders-maven-plugin.version>2024.6.0</expanders-maven-plugin.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>net.democritus.maven.plugins</groupId>
<artifactId>expanders-maven-plugin</artifactId>
<version>${expanders-maven-plugin.version}</version>
</plugin>
</plugins>
</build>
</project>