gnodet-bot commented on code in PR #1221:
URL: 
https://github.com/apache/maven-compiler-plugin/pull/1221#discussion_r4750197842


##########
src/site/markdown/examples/exclude-sources.md.vm:
##########
@@ -0,0 +1,83 @@
+---
+title: Exclude Sources
+author:
+  - Umer Hassan Butt
+date: 2026-12-01
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Exclude Sources
+
+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 `/`.
+
+For example, this configuration excludes all Java sources under
+`src/main/java/com/example/legacy`, including its subdirectories:
+
+```xml
+<project>
+  [...]
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>${project.version}</version>
+        <configuration>
+          <excludes>
+            <exclude>com/example/legacy/**</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  [...]
+</project>
+```
+
+Run `mvn compile` to compile the remaining main sources. In a multi-module 
build,

Review Comment:
   💬 **Run-on sentence (33 words, two clauses).** Split for clarity:
   
   ```suggestion
   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.
   ```



##########
src/site/markdown/examples/exclude-sources.md.vm:
##########
@@ -0,0 +1,83 @@
+---
+title: Exclude Sources
+author:
+  - Umer Hassan Butt
+date: 2026-12-01
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Exclude Sources
+
+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 `/`.
+

Review Comment:
   ⚠️ **Weak constraint phrasing.** `should not` reads as a recommendation, but 
leading `/` simply doesn't work — the pattern won't match anything. Use an 
imperative:
   
   ```suggestion
   files or directories from main compilation. Patterns are relative to each 
source
   root, such as `src/main/java`. Do not start patterns with `/`.
   ```



##########
src/site/markdown/examples/exclude-sources.md.vm:
##########
@@ -0,0 +1,83 @@
+---
+title: Exclude Sources
+author:
+  - Umer Hassan Butt
+date: 2026-12-01
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Exclude Sources
+
+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 `/`.
+
+For example, this configuration excludes all Java sources under
+`src/main/java/com/example/legacy`, including its subdirectories:
+
+```xml
+<project>
+  [...]
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>${project.version}</version>
+        <configuration>
+          <excludes>
+            <exclude>com/example/legacy/**</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  [...]
+</project>
+```
+
+Run `mvn compile` to compile the remaining main sources. 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.
+
+## Exclude Test Sources
+
+Main-source exclusions do not apply to test compilation. To exclude test source
+files or directories, use
+[`testExcludes`](../testCompile-mojo.html#testExcludes) in the same plugin
+configuration:
+
+```xml
+<testExcludes>
+  <testExclude>com/example/legacy/**</testExclude>
+</testExcludes>
+```
+
+This excludes sources under `src/test/java/com/example/legacy`, including its
+subdirectories, when running `mvn test-compile`.
+
+## Implicit Compilation
+
+These filters select the source files passed explicitly to the compiler. The

Review Comment:
   💬 **Passive construction.** Rewrite in active voice:
   
   ```suggestion
   The compiler only receives the non-excluded source files, so an excluded 
source
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to