Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iluwatar/uml-reverse-mapper
Automatically generate class diagram from code. Supports Graphviz, PlantUML and Mermaid output formats.
https://github.com/iluwatar/uml-reverse-mapper
class-diagram graphviz hacktoberfest maven-plugin mermaid plantuml uml uml-diagram uml-diagrams
Last synced: 3 months ago
JSON representation
Automatically generate class diagram from code. Supports Graphviz, PlantUML and Mermaid output formats.
- Host: GitHub
- URL: https://github.com/iluwatar/uml-reverse-mapper
- Owner: iluwatar
- License: apache-2.0
- Fork: true (NitorCreations/DomainReverseMapper)
- Created: 2015-09-03T18:59:53.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-04-29T18:13:59.000Z (10 months ago)
- Last Synced: 2024-05-01T21:18:17.483Z (10 months ago)
- Topics: class-diagram, graphviz, hacktoberfest, maven-plugin, mermaid, plantuml, uml, uml-diagram, uml-diagrams
- Language: Java
- Homepage:
- Size: 2.12 MB
- Stars: 219
- Watchers: 15
- Forks: 85
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README

[](https://maven-badges.herokuapp.com/maven-central/com.iluwatar.urm/urm-maven-plugin/)
[](https://gitter.im/iluwatar/uml-reverse-mapper?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)# UML Reverse Mapper
Automatically generate class diagram from your code.
Using reflection, UML Reverse Mapper scans your packages that contain your code. It builds the class relations and can output as a [Graphviz](https://www.graphviz.org/) .dot file, a [PlantUML](http://www.plantuml.com/) .puml file or a [Mermaid](https://mermaid-js.github.io/mermaid/#/) .mmd file.
The tool is available in command line version (urm-core) and Maven plugin (urm-maven-plugin).
### Using from the command-line
Build the `urm-core` project with `./mvnw clean package` and grab the generated artifact `urm-core.jar`. Then you need the archive that will be analyzed. In this example we use `abstract-factory.jar` and assume the package name to be `com.iluwatar.abstractfactory`. Place the jar-files in the same directory and execute the following command.
java -cp abstract-factory.jar:urm-core.jar com.iluwatar.urm.DomainMapperCli -p com.iluwatar.abstractfactory -i com.iluwatar.abstractfactory.Castle
This will scan all the classes under the package `com.iluwatar.abstractfactory` except `Castle` that was marked to be ignored and output the markup to your console output. By default PlantUML presenter is used, but it can be changed with switch `-s graphviz` or `-s mermaid`. If you want to write it to file use switch `-f filename`. If you need to scan multiple packages use format `-p "com.package1, com.package2"`. Note that under Windows OS the classpath separator is `;` instead of `:`
### Using the Maven plugin
Add to your pom.xml the following:
```xml
com.iluwatar.urm
urm-maven-plugin
2.1.1
${project.basedir}/etc
com.mycompany.mypackage
com.mycompany.other_package
com.mycompany.mypackage.MyClass
com.mycompany.other_package.OtherClass
true
false
graphviz
process-classes
map
com.example
example
1.0.0
```
- `packages` configuration parameter contains a list of packages that should be included in the class
diagram
- `ignores` configuration parameter contains a list of types that should be excluded from the class
diagram
- `dependencies` list should contain the artifacts where the classes are found. See https://maven.apache.org/guides/mini/guide-configuring-plugins.html#Using_the_dependencies_Tag
- `includeMainDirectory` configuration parameter indicates to include classes of src/main/java
directory. Default value of `includeMainDirectory` is true.
- `includeTestDirectory` configuration parameter indicates to include classes of src/test/java
directory. Default value of `includeTestDirectory` configuration parameter is false.
- `presenter` parameter control which presenter is used. Can be `graphviz`, `plantuml` or `mermaid`.When `process-classes` life-cycle phase gets executed, the class diagram will be saved to the location specified by `outputDirectory` parameter. If not specified the file is saved
to `/target/${project.name}.urm.`, where is one of `dot` (graphiv), `puml` (plantuml), or `mmd` (mermaid). Use this file with your local
or online tools to show your class diagram.### Showcases
Here are some class diagrams generated with the `urm-maven-plugin`.


### Deploy Instructions
[Performing a Release Deployment](http://central.sonatype.org/pages/apache-maven.html#performing-a-release-deployment)
```
export GPG_TTY=$(tty)
./mvnw clean deploy -P release
```