Skip to main content

NSX Metamodel Project

Creates a new NS metamodel project, provisioned with everything needed for NSX infrastructure.

  • Expansion resource: net.democritus.initializer:nsx-metamodel-initializer@7.0.1
  • Command: nsinit metamodel
  • Example project: GitHub

What this bundle provisions​

  • Metamodel component, either depending on elements, or defining its own ProgramType and DataElement for that ProgramType. Includes expansion settingsExpansion Settings (ExpansionSettings). The core XML configuration file specifying model locations, target expansion output directories, and expansion resources. for the metamodel stack.
  • Maven project to expand the metamodel stack, with or without an expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. module, and deploy the model artifactArtifactA build or deployment result, such as a Docker container image or Java archive, produced by a software project..
  • Standard project files: README.md and CHANGELOG.md (stub files for the user to fill out), and an EditorConfig file with a basic clean-editing setup.
  • Jenkins CI/CD — a Jenkinsfile that expands, builds, and deploys the entire project.
  • Git — a local repository is initialized, with an initial commit containing everything that should be tracked.

Generated files​

  • applications directory with the ApplicationApplicationThe overarching model container grouping all components, domain logic, and configurations for an enterprise solution./ApplicationInstance model, which is used to by program typeProgram TypeAn architectural style with predefined technologies/standards (e.g., 'JEE Application'). for metamodels to define the project.
  • components directory with the metamodel component model and ProgramType DataElement if requested.
  • components/models.xml file which defines a ModelResource with the path to the directory containing the metamodel components.
  • conf/expansionSettings.xml file with the expansion settingsExpansion Settings (ExpansionSettings). The core XML configuration file specifying model locations, target expansion output directories, and expansion resources. for the project.
  • pom.xml file to expand the project and deploy the model artifactArtifactA build or deployment result, such as a Docker container image or Java archive, produced by a software project..
  • .gitignore file to ignore any known files that should not be committed to a Git repository.
  • .editorconfig file with some basic standard rules for formatting code in files.
  • README.md file to provide some basic information about the project.
  • CHANGELOG.md file to document changes to the project.
  • Jenkinsfile file with basic configuration to expand and build the project in Jenkins.
  • A local git repository with a first commit containing all generated files.

Parameters​

For an overview, run nsinit metamodel -h.

OptionDescription
-h,
--help
Returns the help with an overview of all commands.
--artifact-idThe artifactArtifactA build or deployment result, such as a Docker container image or Java archive, produced by a software project. identifier that will be used for the model artifactArtifactA build or deployment result, such as a Docker container image or Java archive, produced by a software project. and root POM file of the project.
--comp,
--component
Used to specify the name for the metamodel component.
--program-typeName of the ProgramType that will be defined. Only has an effect if --elements is not present.
--program-type-elementName of the DataElement that will be defined for the ProgramType. Only has an effect if --elements is not present.
--groupid,
--group-id
The groupId for the pom-expansion.xml Maven project file.
--[no-]jenkinsGenerate a Jenkinsfile. Default: true
--[no-]elementsAdd dependency on the elements model to extend it, rather than define a new ProgramType. Default: false
--[no-]expandersGenerate an expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. module. Default: true
--[no-]gitInitialize a local git repository and generate a .gitignore file. Default: true
-DAllows you to set any argument or flag defined for the project type, even those that are implicit. For an argument, the key should be prefixed by arg. and for a flag with flag.. E.g.: -Darg.applicationInstance=test-app
-o,
--output
The directory where the project should be generated, rather than the current directory.
-y,
--yes-to-all
Disables the interactive mode and accepts defaults for all settings that were not specified as arguments.
-f,
--force
Forces the creation of the project, even when the output directory is not empty.

Example​

nsinit metamodel -y -o metaTest --group-id com.example.metatest

Resulting project:

metaTest/
├── applications
│   └── metaTestModel
│   ├── harvest
│   │   └── pom.xml.harvest
│   └── model
│   ├── instances
│   │   └── metatestmodel.xml
│   └── metaTestModel.xml
├── CHANGELOG.md
├── componentsModels.xml
├── conf
│   └── expansionSettings.xml
├── .editorconfig
├── .git
├── .gitignore
├── Jenkinsfile
├── metamodel
│   └── metaTestMetamodel.xml
├── ontologies
│   └── metaTest
│   └── model
│   ├── dataTypes
│   │   ├── Boolean.xml
│   │   ├── Name.xml
│   │   ├── PackageName.xml
│   │   └── Version.xml
│   ├── elementGroups
│   │   └── root.xml
│   └── metaTest.xml
├── pom.xml
├── README.md
├── renovate.json
└── scripts
├── build.nss
├── expand.nss
├── harvest.nss
└── prepare-metamodel.nss