apache / apache/maven-pmd-plugin

Support Inline PMD Rule Configuration

Open
#660 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
66
Forks
55
Avg merge
8d 16h
Merged PRs (30d)
7

Description

Currently, the plugin requires rules to be specified via a ruleset file using the `` element. This approach is inflexible, especially in multi-module Maven projects with parent/child relationships. When a child project inherits plugin configuration from the parent, it does not inherit the ruleset file itself, leading to configuration drift and maintenance challenges.

It should be possible to create inline rule configuration using something like `` element, such as:

```xml

```

This configuration could be resolved at runtime and create a `` file as needed

This would allow parent POMs to define PMD rules that are inherited by child modules without relying on external files, improving maintainability and consistency across large projects.

## Additional context

I am aware that https://maven.apache.org/plugins/maven-pmd-plugin/examples/multi-module-config.html is an alternative, but it seems like an overkill that we need a project just to host the rules

Checkstyle supports this via https://maven.apache.org/plugins/maven-checkstyle-plugin/examples/inline-checker-config.html

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the Maven PMD plugin's existing ruleset configuration and the inline Checkstyle configuration example referenced in the issue. The work is done when parent POMs can define inline PMD rule references that child modules inherit without requiring an external ruleset file.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.