scanpackages
Description
With this configuration parameter it is possible to set a list of packages names which classes should be part of the generated diagram text. It can be combined with a blacklist regular expression to filter out some classes inside these packages.
This configuration parameter can not be combined with the whitelist regular expression configuration parameter.
Example
In the following example there are three dependencies in the maven dependency hierarchy which build the classpath for all further generation:
<dependencies>
<dependency>
<groupId>de.elnarion.util</groupId>
<artifactId>plantuml-generator-util</artifactId>
<version>@project.version@</version>
<classifier>tests</classifier>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.16.1</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
From this classpath all classes of the package "de.elnarion.test.domain.t0006.pck1" and all classes of the package "de.elnarion.test.domain.t0006.pck2", which are also used by the JUnit-tests of the PlantUML generator utility, should be generated as class diagram with the following plugin configuration:
<plugin>
<artifactId>plantuml-generator-maven-plugin</artifactId>
<groupId>de.elnarion.maven</groupId>
<version>@project.version@</version>
<executions>
<execution>
<id>generate-simple-diagram</id>
<goals>
<goal>generate</goal>
</goals>
<phase>generate-test-sources</phase>
<configuration>
<outputFilename>testdiagram1.txt</outputFilename>
<scanPackages>
<scanPackage>de.elnarion.test.domain.t0006.pck1</scanPackage>
<scanPackage>de.elnarion.test.domain.t0006.pck2</scanPackage>
</scanPackages>
</configuration>
</execution>
</executions>
</plugin>
which is rendered this way:
and produces this PlantUML diagram text:
@startuml
class de.elnarion.test.domain.t0006.pck1.ClassA {
}
class de.elnarion.test.domain.t0006.pck1.ClassB {
}
class de.elnarion.test.domain.t0006.pck2.ClassC {
}
de.elnarion.test.domain.t0006.pck1.ClassA --> de.elnarion.test.domain.t0006.pck1.ClassB : classB
de.elnarion.test.domain.t0006.pck1.ClassB --> de.elnarion.test.domain.t0006.pck2.ClassC : classc
@enduml