Coder Social home page Coder Social logo

talsma-ict / umldoclet Goto Github PK

View Code? Open in Web Editor NEW
231.0 10.0 32.0 94.6 MB

Automatically generate PlantUML diagrams in javadoc

License: Apache License 2.0

Java 99.99% Batchfile 0.01%
javadoc doclet plantuml diagram generator code-analysis uml

umldoclet's Introduction

CI build Maven Version Javadoc Codebeat badge Coverage Status

UMLDoclet

Doclet for javadoc to automatically add UML diagrams to Java documentation.

Generate UML diagrams

The UML Doclet uses available javadoc metadata to automatically generate the following UML diagrams and embeds them in your HTML documentation. The diagrams are embedded as clickable SVG objects by default and link to package and class documentation where available.

Package dependency diagram

The UML Doclet will warn about (and optionally fail on) cyclic package dependencies.

The dependency diagram links to package documentation containing:

Package diagram

The package diagram links to class documentation containing:

Class diagram

(These examples are from the latest UML Doclet javadoc page. Please feel free to take a look to get an idea of the final result)

Requirements

To use the UML Doclet, the following is required.

  • Javadoc version 9 or higher.
    For versions of javadoc from earlier JDKs, please use the latest 1.x UML Doclet version. If you compile your java 8 or older javadocs with a more recent JDK (Javadoc version 9 or higher), you need to use the 2.x version.
  • The UML Doclet, the usage page shows how. An apache-licensed version of PlantUML is already included in the umldoclet jar.

Releases

Released versions can be found in the maven central repository or on github.

Usage

  • Please see the separate usage page on how to use the UML Doclet in your own Java projects.

Feedback

  • We welcome new issues. Please search the current issues to avoid filing a duplicate.
  • If at all possible, please provide an example when sending in bugs. This will make fixing them that much easier!

Contributing

Thanks

  • First of all a big thanks to Arnaud Roques, the developer of the excellent PlantUML project without whom this project wouldn't exist!
  • And of course thank you for using UML Doclet. I hope it may be of benefit to your project!

License

umldoclet's People

Contributors

dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar ludelafo avatar sjoerdtalsma avatar talsma-ci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

umldoclet's Issues

Multi-version jar

JDK 9 introduced the multiversion jar concept.

This may provide a neat way to release a single jar that is the 2.x version, but contains the old 1.x javadoc api version.

Send images to a single directory

It is difficult to embed the images (package.jpg for example) in Javadoc because they cannot be located using <img...> tags from multiple locations (the overview pages and per-package pages).

The suggested solution is to send the images to a single directory with the image files having fully package qualified names, for example org.johnWorrell.mypackage.package.jpg.

Package dependencies

  1. Properties are rendered inversely (e.g. <.. instead of ..> ).
  2. Lines must be solid ( --> instead of ..> )

Add dependency diagrams showing all dependencies on package level.

Not quite sure what I meant by this in my initial ideas.
Probably this could mean an additional diagram as a variant to the current package.puml / class.puml creation that shows all dependencies instead of focussing on readability.

Let's play with it and see where that leads us.

Simplify classname within namespace.

If a class is rendered within a namespace, it is currently rendered using its fully qualified name (since that is easiest and pretty much always correct).

However, within a namespace, the namespace itself can (and arguably should) be left out.

Automatic inclusion in Standard documentation

It would be nice if Standard class documentation included appropriate diagrams automatically when using the doclet.

Note that this is currently already available, however requires custom <img> tags.

Add test coverage reporting

This involves the following steps:

  • Using a maven coverage tool such as jacoco
  • Figure out how to instrument the maven javadoc plugin to suit tools like jacoco!
  • Reporting to an online service such as coveralls.io
  • Adding a CI coverage badge to the README file.

class visibility does not work.

Package-protected classes are rendered the same as public classes in the package diagram.

They should either be marked differently or removed from the diagram altogether.
Their individual class-diagram can be generated normally of course.

Generics support

Generics are currently ignored.
The generic type information is valuable and should be included.

Improve support for annotations

Annotations currently extend java.lang.Annotation and are declared as abstract classes.

It might be better to create a specialized renderer for annotations and provide them with their own symbol instead of the A for abstract classes (use an @ if possible).

No dot executable found

I must be doing something wrong...In order to activate the doclet, I had to remove the execution from the suggested pom.xml configuration. Then after running 'mvn javadoc:javadoc', the generated PNG files contain the message "No dot executable found", but I have confirmed that dot.exe is in my PATH. What am I missing?

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<doclet>nl.talsmasoftware.umldoclet.UMLDoclet</doclet>
<docletArtifact>
<groupId>nl.talsmasoftware</groupId>
<artifactId>umldoclet</artifactId>
<version>1.0.17</version>
</docletArtifact>
<additionalOptions>
<additionalOption>-umlLogLevel DEBUG</additionalOption>
<additionalOption>-umlImageFormat PNG</additionalOption>
</additionalOptions>
</configuration>
</plugin>

Feature request: ability to influence the style of generated diagrams.

Hi,

I'd like to see the functionality added for influencing style changes to generated diagram.
For instance, a way to add "hide class circle" to the generated puml.

For the how of this request: If one could supply an "!include directive" to some location to this doclet, that would do the trick, I think.

Thanks in advance!

Kind regards,

Herman de Boer.

Sanitize and/or group the many settings for this doclet.

Furthermore, consider allowing per-package / class / method / field overrides through javadoc tags where applicable.

Additionally, at least add support for the settings used by the old legacy doclet.

Thirdly, check out the parameters of the Standard doclet, and see if these can serve as decent defaults (and whether that's desirable; I can imagine someone wanting to document the protected methods, but excluding them from the diagrams by default).

Built-in graphviz alternative

Since we already bundle PlantUML with the doclet, including a few extra libraries may not be so bad to reach an all-in-one solution without depending on graphviz.

A working solution is described here:

It may be possible to include this in the Java 9 (v2.0) doclet rewrite.

Replace .puml sources by new .svg rendering?

Recent SVG rendering engines in plantuml (at least in 1.2017.16) include the plantuml source within XML comments.
Is it then still necessary to keep the .puml files or should we allow that to be replaced by the svg altogether?

It's easy to extract the uml source from the .svg files, just match for the <!--.*(@startuml.*@enduml).*--> regex expression.

How to add PlantUML to the classpath

Could you please extend the documentation on how to add PlantUML to the Maven config, so that SVG will be rendered automatically. I've tried:

<plugin>
    <artifactId>maven-javadoc-plugin</artifactId>

    <dependencies>
        <dependency>
            <groupId>net.sourceforge.plantuml</groupId>
            <artifactId>plantuml</artifactId>
            <version>1.2017.18</version>
        </dependency>
    </dependencies>

    <executions>
        <execution>
            <id>attach-javadocs</id>

            <goals>
                <goal>javadoc</goal>
                <goal>jar</goal>
            </goals>

            <configuration>
                <doclet>nl.talsmasoftware.umldoclet.UMLDoclet</doclet>
                <docletArtifact>
                    <groupId>nl.talsmasoftware</groupId>
                    <artifactId>umldoclet</artifactId>
                    <version>1.0.13</version>
                </docletArtifact>
                <additionalparam>
                    -umlImageFormat SVG
                </additionalparam>
            </configuration>
        </execution>
    </executions>
</plugin>

But the logoutput of umldoclet says there is no PlantUML on the classpath

Allow alternate deprecation strategies.

Currently deprecation is simply ignored.
This is probably not the best default setting.
At least I would like to see the deprecation (by strikethrough?)
Alternatively, allow a setting to remove deprecated classes / methods etc. from the UML altogether to allow for a clean model.

Links in class diagrams don't function anymore.

The link is rendered inside the class instead of making the class clickable like it used to be.
Probably the rendering of

class Name {
   [[link]]
   ...
}

was changed in a recent plantuml version. The following does seem to work though:

class Name [[link]] {
   ...
}

The umldoclet seems to suppress javadoc errors

When invalid javadoc is encountered by the maven build, the build fails with an error, but the error that caused the issue is not printed when the uml doclet is used. Without the uml doclet a clear error is printed about the invalid javadoc.

Maven version: 3.3.3
JDK version: 1.8.0_74

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.