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.

Default value

If not specified the default value is an empty list (ignored).

Example

Here is an example from the JUnit tests using this configuration parameter:

String result = getTestResultString();
String expectedDiagramText = IOUtils.toString(Objects.requireNonNull(classLoader.getResource("class/0006_different_packages.txt")),
        StandardCharsets.UTF_8);
assertNotNull(result);
assertNotNull(expectedDiagramText);
assertEquals(expectedDiagramText.replaceAll("\\s+", ""), result.replaceAll("\\s+", ""));
1 add first package to scan to the list
2 add second package to scan to the list
3 add packages list to the configuration to be the base of the diagram

which is rendered this way:

0006_different_packages_diagram

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