This repository contains the Context Mapper CLI - a command line interface to validate CML files and call generators (currently PlantUML, Context Map, and generic text files via Freemarker template).
The CLI can be downloaded under the following links:
In case you want to include Context Mapper in your Maven or Gradle build, you can use the CLI to call generators (for example with Maven exec plugin).
Gradle:
implementation 'org.contextmapper:context-mapper-cli:6.12.0'
Maven:
<dependency>
<groupId>org.contextmapper</groupId>
<artifactId>context-mapper-cli</artifactId>
<version>6.12.0</version>
</dependency>
$ ./cm validate -h
Context Mapper CLI
usage: cm validate
-h,--help Prints this message.
-i,--input <arg> Path to the CML file which you want to validate.
$ ./cm generate -h
Context Mapper CLI
usage: cm generate
-f,--outputFile <arg> The name of the file that shall be generated
(only used by Freemarker generator, as we cannot
know the file extension).
-g,--generator <arg> The generator you want to call. Use one of the
following values: context-map (Graphical DDD
Context Map), plantuml (PlantUML class-,
component-, and state diagrams.), generic
(Generate generic text with Freemarker template)
-h,--help Prints this message.
-i,--input <arg> Path to the CML file for which you want to
generate output.
-o,--outputDir <arg> Path to the directory into which you want to
generate.
-t,--template <arg> Path to the Freemarker template you want to use.
This parameter is only used if you pass 'generic'
to the 'generator' (-g) parameter.
The following examples illustrate the CLI usage.
./cm validate -i DDD-Sample.cml
./cm generate -i DDD-Sample.cml -g plantuml -o ./output-directory
./cm generate -i DDD-Sample.cml -g context-map -o ./output-directory
./cm generate -i DDD-Sample.cml -g generic -o ./output-directory -t template.md.ftl -f glossary.md
If you want to contribute to this project you can create a fork and a pull request. The project is built with Gradle, so you can import it as Gradle project within Eclipse or IntelliJ IDEA (or any other IDE supporting Gradle).
./gradlew clean build
Contribution is always welcome! Here are some ways how you can contribute:
- Create GitHub issues if you find bugs or just want to give suggestions for improvements.
- This is an open source project: if you want to code, create pull requests from forks of this repository. Please refer to a Github issue if you contribute this way.
- If you want to contribute to our documentation and user guides on our website https://contextmapper.org/, create pull requests from forks of the corresponding page repo https://github.com/ContextMapper/contextmapper.github.io or create issues there.
ContextMapper is released under the Apache License, Version 2.0.