ascheman commented on code in PR #11702:
URL: https://github.com/apache/maven/pull/11702#discussion_r2794410109


##########
impl/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java:
##########
@@ -693,27 +693,27 @@ private void initProject(MavenProject project, 
ModelBuilderResult result) {
 
                 /*
                  * `sourceDirectory`, `testSourceDirectory` and 
`scriptSourceDirectory`
-                 * are ignored if the POM file contains at least one enabled 
<source> element
+                 * are not used if the POM file contains at least one enabled 
<source> element

Review Comment:
   If you agree, we could even simplify AC8 (and won't need a new AC9) as the 
existence of `<sources>` would then mean that any existence of legacy 
configurations should fail the build (independent of the existence of modules):
   
   ## Revised AC8 Definition
   
   **AC8** (Legacy directory validation for projects using `<sources>`):
   
   For **any project** using `<sources>`, the build fails with an **ERROR** if:
   
   1. An explicit legacy directory configuration (`<sourceDirectory>` or 
`<testSourceDirectory>`) exists, OR
   
   2. A `<source>` element specifies a custom `<directory>` AND the default 
legacy directory (e.g., `src/main/java`) exists physically on the filesystem
   
   ### Key Point
   
   **The presence of `<sources>` is the trigger, not whether the project is 
modular or non-modular.**
   
   When a project uses `<sources>`, it opts into the Maven 4.1.0 source model 
entirely. Legacy directory configurations become invalid regardless of 
modularity.
   
   
   
   



-- 
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