Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 22 additions & 18 deletions src/site/apt/examples/violation-exclusions.apt.vm
Original file line number Diff line number Diff line change
Expand Up @@ -89,28 +89,32 @@ org.apache.maven.ClassB=UnusedPrivateField,UnusedFormalParameter,UnusedPrivateMe
If you want more flexibility and exclude classes with a certain name, or whole packages,
for example because of generated code, you have to do this in the <<<<configuration\>>>> section of the plugin,
using the <<<<excludes\>>>> or <<<<excludeRoots\>>>> elements.
To avoid confusion, don't write those to the plugin's configuration as a <<<<build\>>>> and <<<<reporting\>>>> plugin.
Instead, configure the plugin in the <<<<pluginManagement\>>>> section of your POM, so executions of the build and site lifecycle pick it up.

+-----+
<project>
...
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>${project.version}</version>
<configuration>
<excludes>
<exclude>**/*Bean.java</exclude>
<exclude>**/generated/*.java</exclude>
</excludes>
<excludeRoots>
<excludeRoot>target/generated-sources/stubs</excludeRoot>
</excludeRoots>
</configuration>
</plugin>
</plugins>
</reporting>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>${project.version}</version>
<configuration>
<excludes>
<exclude>**/*Bean.java</exclude>
<exclude>**/generated/*.java</exclude>
</excludes>
<excludeRoots>
<excludeRoot>target/generated-sources/stubs</excludeRoot>
</excludeRoots>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
...
</project>
+-----+