gnodet-bot commented on code in PR #14006:
URL: https://github.com/apache/maven/pull/14006#discussion_r4575155559


##########
api/maven-api-model/src/main/mdo/maven.mdo:
##########
@@ -1531,6 +1531,19 @@
           </description>
           <type>String</type>
         </field>
+        <field>
+          <name>deprecated</name>
+          <version>4.1.0+</version>
+          <type>boolean</type>
+          <defaultValue>false</defaultValue>
+          <description>Indicates whether this project/artifact is 
deprecated.</description>
+       </field>
+       <field>
+           <name>deprecationMessage</name>
+           <version>4.1.0+</version>
+          <type>String</type>
+          <description>A message from developers explaining the deprecation or 
alternative.</description>
+        </field>

Review Comment:
   ⚠️ **Wrong model class and missing implementation.** These fields are added 
to `DistributionManagement` (line 1469 of the base file), which is the class 
for `repository`, `snapshotRepository`, `site`, `relocation`, and `status`. 
Deprecation is a project-level metadata concern — 
`project.getDistributionManagement().isDeprecated()` has no semantic meaning. 
These fields belong in the `Model` class (the root `<project>` element).
   
   Additionally:
   - No consumer code reads `deprecated=true` to emit a warning during 
dependency resolution or build
   - No validation rule enforces constraints
   - No integration test exercises this feature
   
   A model field with no consumers is dead code. The feature needs 
implementation wiring and tests before it can be accepted.
   
   Also, the indentation is inconsistent with the surrounding XML — see the 
`</field>` closing `deprecated` and the `<field>`/`<name>`/`<version>` opening 
`deprecationMessage` using 7/11 spaces instead of the 8/10 used by all 
surrounding fields:
   
   ```suggestion
           <field>
             <name>deprecated</name>
             <version>4.1.0+</version>
             <type>boolean</type>
             <defaultValue>false</defaultValue>
             <description>Indicates whether this project/artifact is 
deprecated.</description>
           </field>
           <field>
             <name>deprecationMessage</name>
             <version>4.1.0+</version>
             <type>String</type>
             <description>A message from developers explaining the deprecation 
or alternative.</description>
           </field>
   ```



##########
api/maven-api-core/src/main/java/org/apache/maven/api/DependencyScope.java:
##########
@@ -102,6 +102,10 @@ public enum DependencyScope {
      * by the JDK or the runtime environment/container. Dependencies in this 
scope are available on
      * the main compile, test compile, and test runtime classpaths, but not on 
the main runtime
      * classpath. Dependencies in this scope are not transitive to downstream 
projects.
+     * <p>
+     * <b>Transitive behavior:</b> Its transitive {@code compile} and {@code 
runtime} dependencies
+     * become {@code provided}, while its transitive {@code provided} and 
{@code test} dependencies
+     * are omitted.

Review Comment:
   ❌ **Factually incorrect for Maven 4.** `DependencyScope.PROVIDED` is 
declared as `PROVIDED("provided", false)`, meaning `isTransitive()` returns 
`false`. In Maven 4, all transitive dependencies of a `provided` dependency are 
**omitted entirely** — they do not "become provided". The added text describes 
Maven 3's scope mediation matrix, not Maven 4's behavior.
   
   Furthermore, the existing javadoc immediately above already states 
*"Dependencies in this scope are not transitive to downstream projects"*, which 
directly contradicts the new paragraph.
   
   Remove this addition — the existing sentence already correctly documents 
Maven 4 behavior. If the Maven 3 behavior is worth documenting for migration 
purposes, it should be clearly scoped as such and placed in a separate note, 
not presented as the current behavior.



##########
its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java:
##########
@@ -169,10 +169,10 @@ protected Verifier newVerifier(Path basedir, String 
settings, boolean createDotM
             }
         }
 
-        // auto set source+target to lowest reasonable java version
-        verifier.getSystemProperties().put("maven.compiler.source", "8");
-        verifier.getSystemProperties().put("maven.compiler.target", "8");
-        verifier.getSystemProperties().put("maven.compiler.release", "8");
+        // Maven 4 requires JDK 17; use 17 as the baseline for IT-compiled 
projects.
+        verifier.getSystemProperties().put("maven.compiler.release", "17");
+        verifier.getSystemProperties().remove("maven.compiler.source");
+        verifier.getSystemProperties().remove("maven.compiler.target");

Review Comment:
   ⚠️ **Sweeping change with insufficient audit.** Setting 
`maven.compiler.release=17` as a global system property overrides POM-level 
`maven.compiler.source`/`maven.compiler.target` properties in IT fixture POMs. 
Only `mng-5530` gets an explicit `release=8` override in this PR, but other IT 
fixtures that set their own compiler level in the POM (e.g., `mng-6972` sets 
`maven.compiler.source=1.8`) will silently compile at Java 17.
   
   This change requires a comprehensive audit of all IT fixture POMs that 
declare their own compiler properties. Any fixture compiled against APIs that 
were removed or changed between Java 8 and 17 will start failing. This change 
also belongs in a separate dedicated PR, not bundled with MNG-8658.



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