You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "anukalp2804 (via GitHub)" <gi...@apache.org> on 2025/12/21 19:03:18 UTC

[PR] Document deprecation rationale for Artifact version constants [maven]

anukalp2804 opened a new pull request, #11584:
URL: https://github.com/apache/maven/pull/11584

   Summary:
   This pull request documents the rationale for deprecating the Artifact version
   constants RELEASE and LATEST.
   
   Why:
   The RELEASE and LATEST version constants lead to non-reproducible builds and are
   discouraged in Maven 4. This change makes the reason for deprecation explicit
   and provides guidance on preferred alternatives.
   
   What:
   - Added JavaDoc explaining why these constants are deprecated
   - Clarified recommended usage of explicit versions or version ranges
   
   Scope:
   - Documentation-only change
   - No behavioral or API changes
   
   Testing:
   - mvn verify (BUILD SUCCESS)
   
   
   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
   - [✓] Your pull request should address just one issue, without pulling in other changes.
   - [✓] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [✓] Each commit in the pull request should have a meaningful subject line and body.
     Note that commits might be squashed by a maintainer on merge.
   - [ ] Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
     This may not always be possible but is a best-practice.
   - [✓] Run `mvn verify` to make sure basic checks pass.
     A more thorough check will be performed on your pull request automatically.
   - [ ] You have run the [Core IT][core-its] successfully.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
   - [✓] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   - [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   [core-its]: https://maven.apache.org/core-its/core-it-suite/
   


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo commented on code in PR #11584:
URL: https://github.com/apache/maven/pull/11584#discussion_r2712832134


##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java:
##########
@@ -37,9 +37,21 @@
  */
 public interface Artifact extends Comparable<Artifact> {
 
+    /**
+     * @deprecated
+     * The use of the {@code RELEASE} version is discouraged because it results
+     * in non-reproducible builds.

Review Comment:
   and supply chain attacks



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "desruisseaux (via GitHub)" <gi...@apache.org>.
desruisseaux commented on code in PR #11584:
URL: https://github.com/apache/maven/pull/11584#discussion_r2768028910


##########
api/maven-api-core/src/main/java/org/apache/maven/api/Language.java:
##########
@@ -55,7 +55,7 @@ public interface Language extends ExtensibleEnum {
      *
      * @deprecated Use {@link #RESOURCES} instead.
      */
-    @Deprecated
+    @Deprecated(since = "4.0.0", forRemoval = false)

Review Comment:
   The `forRemoval = false` part is not necessary as `false` is the default value.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo commented on code in PR #11584:
URL: https://github.com/apache/maven/pull/11584#discussion_r3287818019


##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java:
##########
@@ -37,9 +37,19 @@
  */
 public interface Artifact extends Comparable<Artifact> {
 
+    /**
+     * @deprecated The use of the {@code RELEASE} version is discouraged because it results
+     * in non-reproducible builds and exposes projects to potential supply chain attacks.
+     * Use explicit versions instead.
+     */
     @Deprecated(since = "4.0.0")
     String RELEASE_VERSION = "RELEASE";
 
+    /**
+     * @deprecated The use of the {@code LATEST} version is discouraged because it results
+     * in non-reproducible builds and exposes projects to potential supply chain attacks.

Review Comment:
   delete "potential"



##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java:
##########
@@ -37,9 +37,19 @@
  */
 public interface Artifact extends Comparable<Artifact> {
 
+    /**
+     * @deprecated The use of the {@code RELEASE} version is discouraged because it results
+     * in non-reproducible builds and exposes projects to potential supply chain attacks.

Review Comment:
   delete "potential"



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "anukalp2804 (via GitHub)" <gi...@apache.org>.
anukalp2804 commented on code in PR #11584:
URL: https://github.com/apache/maven/pull/11584#discussion_r2691185650


##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java:
##########
@@ -37,9 +37,21 @@
  */
 public interface Artifact extends Comparable<Artifact> {
 
+    /**
+     * @deprecated since 4.0.0.

Review Comment:
   Thanks for the review. Updated the JavaDoc to recommend explicit versions only and removed the redundant version information from the deprecation text.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "anukalp2804 (via GitHub)" <gi...@apache.org>.
anukalp2804 commented on PR #11584:
URL: https://github.com/apache/maven/pull/11584#issuecomment-4519628396

   @elharo , Thank you for review and approve and i have delete `potential`.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "anukalp2804 (via GitHub)" <gi...@apache.org>.
anukalp2804 commented on PR #11584:
URL: https://github.com/apache/maven/pull/11584#issuecomment-3694901072

   Hi, just a gentle reminder. Whenever you get time, please take a look.
   No hurry. Thank you!


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "anukalp2804 (via GitHub)" <gi...@apache.org>.
anukalp2804 commented on PR #11584:
URL: https://github.com/apache/maven/pull/11584#issuecomment-4582491386

   Hi @gnodet , @elharo ,
   Just checking in — this PR was approved earlier. Please let me know if anything else is needed from my side before it can be merged.
   
   Thank you
   


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "anukalp2804 (via GitHub)" <gi...@apache.org>.
anukalp2804 commented on code in PR #11584:
URL: https://github.com/apache/maven/pull/11584#discussion_r2768960134


##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java:
##########
@@ -37,9 +37,22 @@
  */
 public interface Artifact extends Comparable<Artifact> {
 
+    /**
+     * @deprecated
+     * The use of the {@code RELEASE} version is discouraged because it results
+     * in non-reproducible builds and exposes projects to potential
+     * supply chain attacks.
+     * Use explicit versions instead.
+     */
     @Deprecated(since = "4.0.0")
     String RELEASE_VERSION = "RELEASE";
 
+    /**
+     * @deprecated
+     * The use of the {@code LATEST} version is discouraged because it results
+     * in non-reproducible builds.

Review Comment:
   Good point — I’ve updated the deprecation note to mention the supply chain risk as suggested.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo commented on code in PR #11584:
URL: https://github.com/apache/maven/pull/11584#discussion_r2768497465


##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java:
##########
@@ -37,9 +37,22 @@
  */
 public interface Artifact extends Comparable<Artifact> {
 
+    /**
+     * @deprecated
+     * The use of the {@code RELEASE} version is discouraged because it results
+     * in non-reproducible builds and exposes projects to potential
+     * supply chain attacks.
+     * Use explicit versions instead.
+     */
     @Deprecated(since = "4.0.0")
     String RELEASE_VERSION = "RELEASE";
 
+    /**
+     * @deprecated
+     * The use of the {@code LATEST} version is discouraged because it results
+     * in non-reproducible builds.

Review Comment:
   nd exposes projects to potential
        * supply chain attacks.



##########
api/maven-api-core/src/main/java/org/apache/maven/api/Language.java:
##########
@@ -55,7 +55,7 @@ public interface Language extends ExtensibleEnum {
      *
      * @deprecated Use {@link #RESOURCES} instead.
      */
-    @Deprecated
+    @Deprecated(since = "4.0.0", forRemoval = false)

Review Comment:
   I'm OK with it. It's still clearer in code to have the explicit  forRemoval = false)



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "anukalp2804 (via GitHub)" <gi...@apache.org>.
anukalp2804 commented on code in PR #11584:
URL: https://github.com/apache/maven/pull/11584#discussion_r2769762915


##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java:
##########
@@ -37,9 +37,23 @@
  */
 public interface Artifact extends Comparable<Artifact> {
 
+    /**
+     * @deprecated
+     * The use of the {@code RELEASE} version is discouraged because it results

Review Comment:
   Adjusted formatting so the deprecation text starts on the same line and is properly indented.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo commented on code in PR #11584:
URL: https://github.com/apache/maven/pull/11584#discussion_r2687649061


##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java:
##########
@@ -37,9 +37,21 @@
  */
 public interface Artifact extends Comparable<Artifact> {
 
+    /**
+     * @deprecated since 4.0.0.
+     * The use of the {@code RELEASE} version is discouraged because it results
+     * in non-reproducible builds.
+     * Use an explicit version or a version range instead.

Review Comment:
   never use a version range foe the same reasons. Explicit versions only



##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java:
##########
@@ -37,9 +37,21 @@
  */
 public interface Artifact extends Comparable<Artifact> {
 
+    /**
+     * @deprecated since 4.0.0.

Review Comment:
   do we need since 4.0.0.?



##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java:
##########
@@ -37,9 +37,21 @@
  */
 public interface Artifact extends Comparable<Artifact> {
 
+    /**
+     * @deprecated since 4.0.0.
+     * The use of the {@code RELEASE} version is discouraged because it results
+     * in non-reproducible builds.
+     * Use an explicit version or a version range instead.
+     */
     @Deprecated(since = "4.0.0")
     String RELEASE_VERSION = "RELEASE";
 
+    /**
+     * @deprecated since 4.0.0.
+     * The use of the {@code LATEST} version is discouraged because it results
+     * in non-reproducible builds.
+     * Use an explicit version or a version range instead.

Review Comment:
   ditto



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "anukalp2804 (via GitHub)" <gi...@apache.org>.
anukalp2804 commented on PR #11584:
URL: https://github.com/apache/maven/pull/11584#issuecomment-3708083231

   Just checking in on this PR. It has been idle for a while and is still awaiting workflow approval and review.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "anukalp2804 (via GitHub)" <gi...@apache.org>.
anukalp2804 commented on code in PR #11584:
URL: https://github.com/apache/maven/pull/11584#discussion_r3285323993


##########
api/maven-api-core/src/main/java/org/apache/maven/api/Language.java:
##########
@@ -55,7 +55,7 @@ public interface Language extends ExtensibleEnum {
      *
      * @deprecated Use {@link #RESOURCES} instead.
      */
-    @Deprecated
+    @Deprecated(since = "4.0.0", forRemoval = false)

Review Comment:
   Thanks for the review. Removed the unrelated `Language.java` change from this PR and kept the scope limited to the Artifact version constants documentation.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "anukalp2804 (via GitHub)" <gi...@apache.org>.
anukalp2804 commented on code in PR #11584:
URL: https://github.com/apache/maven/pull/11584#discussion_r2768960134


##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java:
##########
@@ -37,9 +37,22 @@
  */
 public interface Artifact extends Comparable<Artifact> {
 
+    /**
+     * @deprecated
+     * The use of the {@code RELEASE} version is discouraged because it results
+     * in non-reproducible builds and exposes projects to potential
+     * supply chain attacks.
+     * Use explicit versions instead.
+     */
     @Deprecated(since = "4.0.0")
     String RELEASE_VERSION = "RELEASE";
 
+    /**
+     * @deprecated
+     * The use of the {@code LATEST} version is discouraged because it results
+     * in non-reproducible builds.

Review Comment:
   Thanks 
   I’ve updated the deprecation note to mention the supply chain risk as suggested.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "desruisseaux (via GitHub)" <gi...@apache.org>.
desruisseaux commented on code in PR #11584:
URL: https://github.com/apache/maven/pull/11584#discussion_r2777423282


##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java:
##########
@@ -37,9 +37,23 @@
  */
 public interface Artifact extends Comparable<Artifact> {
 
+    /**
+     * @deprecated
+     * The use of the {@code RELEASE} version is discouraged because it results

Review Comment:
   The change was done for `LATEST` but not for `RELEASE`. I suggest to copy-and-paste the commend for `LATEST` and just replace `LATEST` by `RELEASE`.



##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java:
##########
@@ -37,9 +37,23 @@
  */
 public interface Artifact extends Comparable<Artifact> {
 
+    /**
+     * @deprecated
+     * The use of the {@code RELEASE} version is discouraged because it results

Review Comment:
   The change was done for `LATEST` but not for `RELEASE`. I suggest to copy-and-paste the comment for `LATEST` and just replace `LATEST` by `RELEASE`.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "anukalp2804 (via GitHub)" <gi...@apache.org>.
anukalp2804 commented on code in PR #11584:
URL: https://github.com/apache/maven/pull/11584#discussion_r2713334744


##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java:
##########
@@ -37,9 +37,21 @@
  */
 public interface Artifact extends Comparable<Artifact> {
 
+    /**
+     * @deprecated
+     * The use of the {@code RELEASE} version is discouraged because it results
+     * in non-reproducible builds.

Review Comment:
   @elharo , Added supply chain attack risk to the deprecation rationale.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "anukalp2804 (via GitHub)" <gi...@apache.org>.
anukalp2804 commented on code in PR #11584:
URL: https://github.com/apache/maven/pull/11584#discussion_r2777439389


##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java:
##########
@@ -37,9 +37,23 @@
  */
 public interface Artifact extends Comparable<Artifact> {
 
+    /**
+     * @deprecated
+     * The use of the {@code RELEASE} version is discouraged because it results

Review Comment:
   Aligned the `RELEASE` deprecation comment with `LATEST` by copying the same text and adjusting the name as suggested.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo commented on code in PR #11584:
URL: https://github.com/apache/maven/pull/11584#discussion_r2769169204


##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java:
##########
@@ -37,9 +37,23 @@
  */
 public interface Artifact extends Comparable<Artifact> {
 
+    /**
+     * @deprecated
+     * The use of the {@code RELEASE} version is discouraged because it results

Review Comment:
   This should start in.the same line as the tag and then be indented four spaces



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #11584:
URL: https://github.com/apache/maven/pull/11584#discussion_r3284360591


##########
api/maven-api-core/src/main/java/org/apache/maven/api/Language.java:
##########
@@ -55,7 +55,7 @@ public interface Language extends ExtensibleEnum {
      *
      * @deprecated Use {@link #RESOURCES} instead.
      */
-    @Deprecated
+    @Deprecated(since = "4.0.0", forRemoval = false)

Review Comment:
   This change is out of scope for this PR -- the title and description only mention documenting the `Artifact` version constants. Also, `forRemoval = false` is the default value, so adding it explicitly is redundant. Please either drop this change or split it into its own PR.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Document deprecation rationale for Artifact version constants [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet merged PR #11584:
URL: https://github.com/apache/maven/pull/11584


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org