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


##########
impl/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/AbstractLifecycleMappingProvider.java:
##########
@@ -35,29 +36,51 @@
  */
 public abstract class AbstractLifecycleMappingProvider implements 
Provider<LifecycleMapping> {
     // START SNIPPET: versions
-    protected static final String RESOURCES_PLUGIN_VERSION = "3.3.1";
+    /** @deprecated Use {@link PluginVersions#RESOURCES} instead. */
+    @Deprecated(since = "4.1.0", forRemoval = true)

Review Comment:
   ⚠️ **Subclasses not migrated — self-contradictory deprecation.**
   
   All 11 constants are deprecated with `forRemoval = true` and Javadoc 
pointing callers to `PluginVersions.*`, but none of the 8 subclasses in this 
package (`BomLifecycleMappingProvider`, `EarLifecycleMappingProvider`, 
`EjbLifecycleMappingProvider`, `JarLifecycleMappingProvider`, 
`MavenPluginLifecycleMappingProvider`, `PomLifecycleMappingProvider`, 
`RarLifecycleMappingProvider`, `WarLifecycleMappingProvider`) are updated. 
Every one of them still references `RESOURCES_PLUGIN_VERSION`, 
`COMPILER_PLUGIN_VERSION`, etc. directly.
   
   This means the module itself will compile with deprecation warnings against 
its own deprecated API, which is contradictory. Either:
   1. Update all subclasses to use `PluginVersions.*` directly in this PR 
(preferred — the constants exist solely to be used by these subclasses, so the 
migration is self-contained and straightforward), or
   2. Don't deprecate the constants yet — wait until a follow-up PR migrates 
the consumers first.
   
   Option 1 is the right call here. The constants are `protected` and 
internal-only; migrating 8 short files in the same package is low risk and 
keeps the change complete.



##########
impl/maven-core/src/main/java/org/apache/maven/lifecycle/PluginVersions.java:
##########
@@ -0,0 +1,81 @@
+/*
+ * 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.
+ */
+package org.apache.maven.lifecycle;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+/**
+ * Provides default plugin versions for the built-in lifecycle bindings.
+ * <p>
+ * Versions are read from {@code plugin-versions.properties}, which is filtered
+ * at build time from POM properties ({@code version.maven-<name>-plugin}).
+ * Centralising them in the POM makes them visible to dependency-update bots
+ * such as Dependabot and Renovate.
+ *
+ * @since 4.1.0

Review Comment:
   ⚠️ **Wrong `@since` version for a backport to `maven-4.0.x`.**
   
   This class is being introduced for the first time on the `maven-4.0.x` 
branch (project version `4.0.0-SNAPSHOT`). The `@since 4.1.0` tag was correct 
in the original #13080 (targeting `master`/4.1.0-SNAPSHOT), but here it should 
reflect the `4.0.x` release in which this class first appears.
   
   Same issue in `AbstractLifecycleMappingProvider` — all 11 `@Deprecated(since 
= "4.1.0", ...)` annotations have the wrong version.
   
   ```suggestion
    * @since 4.0.0
   ```



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