Skip to content

docs: explain source directory exclusions - #1221

Open
Umer-Butt07 wants to merge 3 commits into
apache:masterfrom
Umer-Butt07:docs/exclude-source-directories
Open

Umer-Butt07 wants to merge 3 commits into
apache:masterfrom
Umer-Butt07:docs/exclude-source-directories

Conversation

@Umer-Butt07

Copy link
Copy Markdown

Closes #721.

Add an example for excluding source directories, including recursive patterns and configuration for a single module. Cover test-source exclusions separately and explain the compiler's implicit-compilation behavior. The guide is linked from the Examples menu.

Checks:

  • mvn -Prun-its verify: 51 unit tests and 74 integration builds passed, with 6 skips.
  • mvn -Preporting -DskipTests site: built the site and checked the generated page, menu and parameter links.
  • Built the copied XML in a two-module reactor, checking main/test exclusions, nested directories and the unaffected sibling module. Removing the exclusions fails as expected.

AI helped with the guide, checks and PR text.


@gnodet-bot gnodet-bot 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.

These filters select the source files passed explicitly to the compiler. The compiler may still find an excluded source on the source path and compile it implicitly if another source references it. See the implicit parameter for control over implicit class-file generation with javac.

A few doc-quality observations:

1. Weak should not on a hard constraint (line 32)

Patterns are relative to each source root, such as src/main/java, and should not start with /.

The constraint is not advisory — leading slashes simply won't match. Use direct phrasing: "Patterns are relative to each source root, such as src/main/java. Do not start patterns with /."

2. Run-on sentence in the multi-module paragraph (lines 55–57)

In a multi-module build, put this configuration in the POM of the module that needs the exclusion, rather than in a parent POM where it would be inherited by the other modules.

This is a 33-word sentence chaining two clauses. Split: "In a multi-module build, put this configuration in the module POM that needs the exclusion. Do not add it to a parent POM — it would be inherited by all child modules."

3. Implicit-compilation note — passive construction (lines 79–80)

These filters select the source files passed explicitly to the compiler.

Rewrite: "These filters select which source files the compiler receives explicitly." or simply lead with the action: "The compiler only receives the non-excluded source files."

4. date: front-matter
Other example pages use the page's original creation date in the front matter (e.g. 2006-07-05). Using today's date is unusual but not wrong — it just differs from existing convention. Worth aligning with the project style if maintainers care about it.


No correctness issues. The parameter links (excludes, testExcludes, implicit) and the XML snippet are accurate. LGTM structurally.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Use the [`excludes`](../compile-mojo.html#excludes) parameter to exclude source
files or directories from main compilation. Patterns are relative to each source
root, such as `src/main/java`, and should not start with `/`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Weak constraint phrasing. should not reads as a recommendation, but leading / simply doesn't work — the pattern won't match anything. Use an imperative:

Suggested change
files or directories from main compilation. Patterns are relative to each source
root, such as `src/main/java`. Do not start patterns with `/`.

Comment on lines +55 to +57
```

Run `mvn compile` to compile the remaining main sources. In a multi-module build,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💬 Run-on sentence (33 words, two clauses). Split for clarity:

Suggested change
```
Run `mvn compile` to compile the remaining main sources. In a multi-module build,
Run `mvn compile` to compile the remaining main sources. In a multi-module build,
put this configuration in the module POM that needs the exclusion. Do not add it
to a parent POM — it would be inherited by all child modules.


## Implicit Compilation

These filters select the source files passed explicitly to the compiler. The

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💬 Passive construction. Rewrite in active voice:

Suggested change
These filters select the source files passed explicitly to the compiler. The
The compiler only receives the non-excluded source files, so an excluded source

@desruisseaux

Copy link
Copy Markdown
Contributor

Adding the "3.x" label because the recommended way to exclude files would be different with version 4.x of the plugin.

@Umer-Butt07

Copy link
Copy Markdown
Author

thanks, updated the wording in all three places. the site build passes too.

@gnodet-bot gnodet-bot 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.

Following up on my earlier review — all three wording findings are addressed.

  • "should not start" → "Do not start patterns with /" ✅
  • Run-on sentence in the multi-module paragraph — split ✅
  • Passive "source files passed explicitly" → "source files the plugin passes explicitly" ✅

One remaining nit in the new commit: "Configuration in a parent POM is inherited by its child modules." still uses passive voice. Active rewrite:

Child modules inherit any configuration set in a parent POM.

This also makes the caution slightly more explicit (parent POM → all children, not just some).


This review was generated by an AI agent, Hermès on behalf of @gnodet.

Comment on lines +58 to +59
put this configuration in the module POM that needs the exclusion. Configuration
in a parent POM is inherited by its child modules.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Nit (passive voice): "is inherited by" is passive. Consider:

Suggested change
put this configuration in the module POM that needs the exclusion. Configuration
in a parent POM is inherited by its child modules.
put this configuration in the module POM that needs the exclusion. Child modules
inherit any configuration set in a parent POM.

@gnodet-bot gnodet-bot 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.

Previous findings are all addressed. LGTM.

  • "Do not start patterns with /" (direct phrasing) ✅
  • Multi-module paragraph split into two shorter sentences ✅
  • "Child modules inherit any configuration set in a parent POM." (active voice) ✅

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@Umer-Butt07

Copy link
Copy Markdown
Author

done, changed that sentence to active voice and rebuilt the site. the rendered page and links check out.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MCOMPILER-521] Documentation: <exclude> option

3 participants