Skip to content

Commit

Permalink
update and fix checkstyle and javadoc plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian authored and arnaudroques committed Oct 11, 2021
1 parent 8d5be87 commit 098e630
Show file tree
Hide file tree
Showing 27 changed files with 370 additions and 293 deletions.
19 changes: 19 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"java.configuration.updateBuildConfiguration": "automatic",
"cSpell.words": [
"Arnaud",
"ditaa",
"endditaa",
"enduml",
"epstext",
"etag",
"Lalloni",
"plantuml",
"Roques",
"servlet",
"servlets",
"startditaa",
"startuml"
],
"cSpell.allowCompoundWords": true
}
8 changes: 4 additions & 4 deletions COPYING
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Expand Down Expand Up @@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

Expand All @@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.

The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.
111 changes: 54 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,130 +1,127 @@
PlantUML Server
===============
[![Build Status](https://travis-ci.org/plantuml/plantuml-server.png?branch=master)](https://travis-ci.org/plantuml/plantuml-server)
[![](https://images.microbadger.com/badges/image/plantuml/plantuml-server.svg)](https://microbadger.com/images/plantuml/plantuml-server "Get your own image badge on microbadger.com")
[![Docker Pull](https://img.shields.io/docker/pulls/plantuml/plantuml-server.svg)](https://hub.docker.com/r/plantuml/plantuml-server/)
# PlantUML Server

![workflow status](https://github.com/plantuml/plantuml-server/actions/workflows/main.yml/badge.svg)
[![docker pulls](https://img.shields.io/docker/pulls/plantuml/plantuml-server.svg)](https://hub.docker.com/r/plantuml/plantuml-server)

PlantUML Server is a web application to generate UML diagrams on-the-fly.

![](https://raw.githubusercontent.com/ftomassetti/plantuml-server/readme/screenshots/screenshot.png)
![PlantUML Server](https://raw.githubusercontent.com/plantuml/plantuml-server/master/screenshots/screenshot.png)

To know more about PlantUML, please visit http://plantuml.com/.
To know more about PlantUML, please visit https://plantuml.com.


Requirements
============
## Requirements

* jre/jdk 1.6.0 or above
* apache maven 3.0.2 or above
- jre/jdk 1.6.0 or above
- apache maven 3.0.2 or above

How to run the server
=====================

## How to run the server

Just run:

```
```sh
mvn jetty:run
```

The server is now listing to [http://localhost:8080/plantuml](http://localhost:8080/plantuml).
The server is now listening to [http://localhost:8080/plantuml](http://localhost:8080/plantuml).
In this way the server is run on an embedded jetty server.

You can specify the port at which it runs:

```
```sh
mvn jetty:run -Djetty.port=9999
```

How to run the server with Docker
=================================

## How to run the server with Docker

You can run Plantuml with jetty or tomcat container
```
```sh
docker run -d -p 8080:8080 plantuml/plantuml-server:jetty
docker run -d -p 8080:8080 plantuml/plantuml-server:tomcat
```

The server is now listing to [http://localhost:8080](http://localhost:8080).
The server is now listening to [http://localhost:8080](http://localhost:8080).

## Read-only container
### Read-only container

The jetty container supports read-only files system, you can run the read-only mode with:
```
docker run -d -p 8080:8080 --read-only -v /tmp/jetty plantuml/plantuml-server:jetty-readonly
```sh
docker run -d -p 8080:8080 --read-only -v /tmp/jetty plantuml/plantuml-server:jetty
```

This makes the container compatible with more restricted environment such as OpenShift, just make sure you mount a volume (can be ephemeral) on `/tmp/jetty`.

## Change base URL
### Change base URL

To run plantuml using different base url, change the `docker-compose.yml` file:
```yaml
environment:
- BASE_URL=plantuml
```
And run `docker-compose up`. This will start a modified version of the image using
the base url `/plantuml`, e.g. http://localhost/plantuml
And run `docker-compose up`. This will start a modified version of the image using the base url `/plantuml`, e.g. http://localhost:8080/plantuml


How to set PlantUML options
=================================
## How to set PlantUML options

You can apply some option to your PlantUML server with environement variable.
You can apply some option to your PlantUML server with environment variable.

If you run the directly the jar, you can pass the option with `-D` flag
```
```sh
java -D THE_ENV_VARIABLE=THE_ENV_VALUE -Djetty.contextpath=/ -jar target/dependency/jetty-runner.jar target/plantuml.war
```
or
```
```sh
mvn jetty:run -D THE_ENV_VARIABLE=THE_ENV_VALUE -Djetty.port=9999
```

If you use docker, you can use the `-e` flag:
```
```sh
docker run -d -p 8080:8080 -e THE_ENV_VARIABLE=THE_ENV_VALUE plantuml/plantuml-server:jetty
```

You can set all the following variables:

- `BASE_URL`
* PlantUML base url
* Default value: `ROOT`
- `PLANTUML_LIMIT_SIZE`
* Limits image width and height
* Default value: `4096`
- `PLANTUML_STATS`
* Set it to `on` to enable [statistics report](http://plantuml.com/statistics-report)
* Default value: `off`
- `HTTP_AUTHORIZATION`
* when calling the `proxy` endpoint, the value of `HTTP_AUTHORIZATION` will be used to set the HTTP Authorization header
* Default value: `null`
- `ALLOW_PLANTUML_INCLUDE`
* Enables `!include` processing which can read files from the server into diagrams. Files are read relative to the current working directory.
* Default value: `false`
Alternate: How to build your docker image
======================================================
* `PLANTUML_LIMIT_SIZE`
* Limits image width and height
* Default value: `4096`
* `GRAPHVIZ_DOT`
* Link to 'dot' executable
* Default value: `/usr/local/bin/dot` or `/usr/bin/dot`
* `PLANTUML_STATS`
* Set it to `on` to enable [statistics report](https://plantuml.com/statistics-report)
* Default value: `off`
* `HTTP_AUTHORIZATION`
* when calling the `proxy` endpoint, the value of `HTTP_AUTHORIZATION` will be used to set the HTTP Authorization header
* Default value: `null`
* `ALLOW_PLANTUML_INCLUDE`
* Enables `!include` processing which can read files from the server into diagrams. Files are read relative to the current working directory.
* Default value: `false`


## Alternate: How to build your docker image

This method uses maven to run the application. That requires internet connectivity.
So, you can use following command to create a self-contained docker image that will "just-work".

*Note: Generate the WAR (instructions further below) prior to running "docker build"*

```sh
docker image build -t plantuml-server:local .
docker run -d -p 8080:8080 plantuml-server:local
```
docker image build -t plantuml-server .
docker run -d -p 8080:8080 plantuml-server
```
The server is now listing to [http://localhost:8080/plantuml](http://localhost:8080/plantuml).
The server is now listening to [http://localhost:8080/plantuml](http://localhost:8080/plantuml).

You may specify the port in `-p` Docker command line argument.


How to generate the war
=======================
## How to generate the war

To build the war, just run:

```
```sh
mvn package
```

Expand Down
51 changes: 32 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?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>
Expand All @@ -8,6 +9,28 @@
<packaging>war</packaging>
<build>
<finalName>plantuml</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.2</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>9.0.1</version>
</dependency>
</dependencies>
<configuration>
<configLocation>${basedir}/src/main/config/checkstyle.xml</configLocation>
<linkXRef>false</linkXRef>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
Expand Down Expand Up @@ -95,24 +118,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.11</version>
<version>3.1.2</version>
<executions>
<execution>
<id>validate</id>
<?m2e execute onConfiguration,onIncremental?>
<phase>validate</phase>
<configuration>
<configLocation>${basedir}/src/main/config/checkstyle.xml</configLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<linkXRef>false</linkXRef>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugin>
</plugins>
</build>
<reporting>
Expand All @@ -129,11 +145,11 @@
</reports>
</reportSet>
</reportSets>
</plugin>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<version>3.3.1</version>
<configuration>
<show>private</show>
<nohelp>true</nohelp>
Expand All @@ -150,24 +166,21 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.11</version>
<configuration>
<configLocation>${basedir}/src/main/config/checkstyle.xml</configLocation>
<encoding>UTF-8</encoding>
<linkXRef>false</linkXRef>
</configuration>
<version>3.1.2</version>
<reportSets>
<reportSet>
<reports>
<report>checkstyle</report>
<report>checkstyle-aggregate</report>
</reports>
</reportSet>
</reportSets>
</reportSets>
</plugin>
</plugins>
</reporting>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<jetty.version>8.0.4.v20111024</jetty.version>
<jetty.port>8080</jetty.port>
<jetty.contextpath>/plantuml</jetty.contextpath>
Expand Down
Loading

0 comments on commit 098e630

Please sign in to comment.