Skip to content

Exclude dev-tooling dotfiles from RAT check#569

Open
ascheman wants to merge 1 commit into
apache:masterfrom
aschemaven:rat-exclude-dev-tooling-dotfiles
Open

Exclude dev-tooling dotfiles from RAT check#569
ascheman wants to merge 1 commit into
apache:masterfrom
aschemaven:rat-exclude-dev-tooling-dotfiles

Conversation

@ascheman

Copy link
Copy Markdown

What & why

Dropping common developer-machine dotfiles into a checkout makes a local
mvn verify fail at apache-rat-plugin:check with "Too many files with
unapproved license"
. These are not project source — they are local
conveniences from version managers and direnv:

  • .sdkmanrc (SDKMAN!)
  • .tool-versions (asdf)
  • .envrc (direnv)
  • .mise.toml (mise)

This adds them to the existing apache-rat-plugin <excludes> list, right
next to .java-version, which is already excluded for exactly the same
reason. combine.children="append" keeps RAT's built-in defaults intact.

Why excludes (and not SPDX headers)

An alternative would be to add an SPDX-License-Identifier / ASF header to each
file. That doesn't fit here: these are third-party tool configuration formats,
not files we author, and carrying a per-file licence comment in every repo for
two lines of payload is exactly the boilerplate this change avoids. Excluding
them centrally in maven-parent mirrors how .gitignore / .editorconfig
(RAT built-in defaults) and .java-version are already handled.

Verification

apache-rat-plugin 0.16.1 (the version pinned by org.apache:apache:38) on a
minimal project containing the four dotfiles:

  • before: BUILD FAILURE, 4 unapproved files;
  • after (with these excludes): BUILD SUCCESS.

Also verified end-to-end against a real apache/maven checkout using a locally
built maven-parent carrying this change: rat:check no longer flags the
dotfiles. CI is unaffected (clean checkouts don't carry these files); this
purely lowers local-developer friction.


  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Run mvn verify to make sure basic checks pass.
  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004

Add .sdkmanrc, .tool-versions, .envrc and .mise.toml to the
apache-rat-plugin <excludes>. These are local developer-machine files
from version managers (SDKMAN!, asdf, mise) and direnv, not project
source; a local `mvn verify` otherwise fails rat-check with
"unapproved license" on them.

This mirrors the existing .java-version exclude already in the same
list; combine.children="append" keeps RAT's built-in defaults.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Updates the parent POM’s Apache RAT configuration to avoid local developer dotfiles (created by common version managers/direnv) causing rat:check failures during local builds.

Changes:

  • Added Apache RAT <exclude> entries for .sdkmanrc, .tool-versions, .envrc, and .mise.toml.
  • Documented these excludes inline as developer-local tooling files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pom.xml
Comment on lines +1285 to +1289
<!-- Developer tooling: version managers / direnv (local, not project source) -->
<exclude>.sdkmanrc</exclude>
<exclude>.tool-versions</exclude>
<exclude>.envrc</exclude>
<exclude>.mise.toml</exclude>

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the catch. The surrounding excludes in this file (lines 1280-1284: .maven/spy.log, dependency-reduced-pom.xml, .asf.yaml) all use bare filenames, and apache-rat-plugin runs per-module with the inherited <excludes> applied against each module's basedir — so a .sdkmanrc in a submodule would still be matched by the bare pattern at that submodule's rat-check execution.

To stay consistent with the surrounding excludes, leaving as bare. Happy to switch all of them (existing + new) to **/... in a follow-up if maintainers prefer the more defensive form everywhere.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be simple file name as is

Comment thread pom.xml
<artifactId>apache-rat-plugin</artifactId>
<configuration>
<excludes combine.children="append">
<exclude>.java-version</exclude>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can put all tools together, line by line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants