The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
To omit a module from one Maven reactor build, use -pl with an exclusion selector, such as mvn verify -pl '!legacy-module'. That removes the module from the selected build—not just from analysis. To keep building the module but skip a particular analyzer, configure that plugin’s <skip>true</skip> setting in the module’s POM. Maven has no universal static-analysis exclusion setting; the right method depends on whether you want to omit a project, skip a plugin, filter source files, or suppress findings.
Choose what you want to exclude
| What you want | Use | What changes |
|---|---|---|
| Leave a module out of one Maven invocation | Maven reactor selection with -pl and an exclusion selector |
The module does not participate in the selected reactor build, including its other goals. |
| Build the module but skip one analyzer there | That plugin’s module-local <skip>true</skip> configuration |
Only the configured plugin execution is skipped; other analyzers and build goals may still run. |
| Skip one analyzer across the invocation | That plugin’s command-line user property | The property applies to matching executions across the invocation, not just one module. |
| Exclude source files or findings | The analyzer’s source filters or suppression settings | The Maven module remains in the build and analysis may still run. |
Maven does not define one common inclusion or exclusion parameter for all plugins. Each analyzer has its own configuration and goal behavior. See Maven’s guide to plugin-specific inclusion and exclusion.
Exclude a module from a single reactor build
Use Maven’s -pl (--projects) option to select reactor projects and exclude the target. For example:
mvn verify -pl '!legacy-module'
Replace legacy-module with a selector for your project. Maven selectors can use a relative module path, :artifactId, or groupId:artifactId. The Maven guide documents project inclusion and exclusion syntax at project selection and exclusions.
#1 Best Overall
The exclamation mark may be interpreted by some shells, so quote or escape the selector as appropriate for your shell; the quoted form above is commonly used in shell examples. Reactor option details differ between Maven 3 and Maven 4, so check the guide’s Maven 3 and Maven 4 comparison for the version you run.
Understand the build impact
This is not a static-analysis-only exclusion. The omitted module is absent from the selected reactor build, so it will not run the other goals in that invocation either. If selected projects depend on projects not otherwise selected, Maven’s -am option can add required projects to the reactor; consider that interaction before combining it with an exclusion. See Maven reactor command-line options.
Keep building the module but skip an analyzer
For a persistent module-specific exception, configure the relevant plugin under <build><plugins> in the target module’s pom.xml. For example, this skips the Checkstyle check in that module:
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
Use the analyzer’s own plugin coordinates and documented parameter. These are examples for the regular goals; confirm the goal actually invoked by your build before relying on the setting.
Rank #3
Checkstyle
For the Checkstyle check goal, <skip>true</skip> skips the entire check. The plugin also exposes the command-line property checkstyle.skip. Its separate skipExec parameter is not equivalent: it skips execution while still scanning the existing output file. See the Checkstyle check-goal parameters.
PMD
For PMD, configure <skip>true</skip> in the module’s plugin configuration. PMD documents this as skipping report generation and also exposes the pmd.skip command-line property. PMD’s <excludes> setting is for source-file patterns relative to a source root; it does not identify a Maven module. See the PMD goal parameters.
SpotBugs
For the regular SpotBugs spotbugs goal, use <skip>true</skip>; the plugin also documents the spotbugs.skip user property. SpotBugs filter files exclude reported bugs, not Maven modules. The plugin has a separate aggregate goal, so check its behavior independently. See the SpotBugs goal parameters and aggregate-goal API.
Use command-line skip properties only for invocation-wide skips
Plugin user properties are useful when you want to skip an analyzer for an entire Maven invocation:
mvn verify -Dcheckstyle.skip=true
mvn verify -Dpmd.skip=true
mvn verify -Dspotbugs.skip=true
These properties belong to the named plugins, not Maven itself. They are not a reliable way to target only one reactor module while leaving the same analyzer enabled in siblings. For a durable per-module exception, put the plugin configuration in that module’s POM.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Why a module exclusion may appear ineffective
You configured a file filter instead of a project selector
Settings named excludes often match files or paths under a module’s source root. Bug filters may suppress selected findings. Neither changes reactor membership. To leave out a whole project for one invocation, use Maven’s project-selection option; to keep the project and skip a plugin there, use that plugin’s module-specific skip setting.
The build runs an aggregate goal
An aggregate goal may collect results across reactor projects, so skipping an ordinary per-module execution does not establish that the module will be absent from the aggregate report. Check the exact goal’s documentation and output. SpotBugs, for example, documents a distinct spotbugs-aggregate goal and its own aggregate-goal API; do not assume its regular goal’s behavior applies to the aggregate.
Recommended Free Tools
Parent and child POM configuration differ
A parent POM may provide shared plugin configuration, while a child module can declare or override the plugin locally. Check the effective POM and the actual goal invocation when a module-level setting appears not to take effect. The Checkstyle multi-module configuration guide specifically cautions that submodule plugin declarations can override top-level configuration.
Verify the exclusion
- Run the exact command. Use the same Maven version, profile, and goal or lifecycle phase as the build where you expect the exclusion to work.
- For
-pl, inspect the reactor summary. Confirm the target module is absent from the selected projects. Remember that this confirms it was left out of the reactor build, not merely skipped for analysis. - For a plugin-local skip, inspect execution output. Look for the plugin’s skip message or confirm that its execution did not run for the target module, while checking that it still ran where expected in sibling modules.
- Check the relevant reports. Inspect the per-module report, or the aggregate output if the build invokes an aggregate goal. A missing or empty report alone does not prove the module was excluded.
- If behavior conflicts with configuration, inspect effective configuration. Review the effective POM, active profiles, plugin declarations in parent and child POMs, and the goal bound to the lifecycle or invoked directly.
When the target is files, generated code, or findings
If you want to omit only particular source files, source roots, test sources, generated sources, or findings, do not exclude the whole Maven module. Configure the relevant analyzer’s source inclusion or exclusion rules, generated-source handling, or finding-suppression mechanism. The parameter names and semantics vary by plugin; check the documentation for the exact goal and version you use. Maven’s guide explains why these settings are plugin-specific: inclusion and exclusion with plugins.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

