Skip to content

Conversation

@anukalp2804
Copy link
Contributor

Summary

Improves documentation for the deprecated Language.SCRIPT constant.

Motivation

Language.SCRIPT is deprecated but lacked structured deprecation metadata.
This change clarifies the rationale, adds since information, and documents
the recommended replacement.

Changes

  • Added deprecation rationale to Javadoc
  • Added @Deprecated(since = "4.0.0-alpha", forRemoval = false)
  • No behavioral or compatibility changes

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

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement 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
you have to acknowledge this by using the following check-box.

Note: This change is documentation-only and does not affect runtime behavior.

@anukalp2804
Copy link
Contributor Author

Gentle ping 🙂
Just checking whether this PR needs anything further from my side.
Happy to update it if needed. Thanks!

@anukalp2804
Copy link
Contributor Author

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

@anukalp2804
Copy link
Contributor Author

Fixed — replaced the plain @deprecated with @deprecated(since = "4.0.0").

@anukalp2804 anukalp2804 requested a review from elharo January 28, 2026 13:04
Copy link
Contributor

@elharo elharo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to answer the question of what someone should do instead.

* This constant is retained for backward compatibility with Maven 3.
*
* @deprecated Use {@link #RESOURCES} instead.
* @deprecated Since Maven 4.0.0-alpha.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to said "Since Maven 4.0.0-alpha" here, this information is already provided in @Deprecated. Instead, we need to said what is the replacement. If the replacement is not RESOURCES, then what should it be?

@anukalp2804
Copy link
Contributor Author

Updated the deprecation documentation to remove the alpha reference and use a stable 4.0.0 version, while explicitly documenting RESOURCES as the replacement. Please let me know if this now matches expectations.

* This constant is retained for backward compatibility with Maven 3.
*
* @deprecated Use {@link #RESOURCES} instead.
* @deprecated Since 4.0.0.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you think RESOURCES is the replacement?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent was to document RESOURCES as the replacement because SCRIPT was historically used for non-Java content in Maven 3, and in Maven 4 such content is handled under the resources language model.

If that assumption is incorrect, I’m happy to update the documentation to point to the correct replacement (or remove the replacement reference entirely if there is no direct equivalent).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, my understanding is that since script are just source files copied verbatim, they can be handled as ordinary resources. The new <source> element has no <lang> value specifically for scripts.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so should it be RESOURCES or should it simply be removed?

* This constant is retained for backward compatibility with Maven 3.
*
* @deprecated Use {@link #RESOURCES} instead.
* @deprecated Since 4.0.0.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need "Since 4.0.0" in the comment? It duplicates @Deprecated(since = "4.0.0"). The Javadoc tool already puts the content of the latter in the generated documentation, therefore the "Since 4.0.0" comment is really not giving any new information.

@anukalp2804
Copy link
Contributor Author

Based on the discussion, I’m comfortable with either approach.

My initial intent in mentioning RESOURCES was to give users a concrete direction, since scripts are effectively treated as ordinary resources in Maven 4. However, if you prefer to avoid naming a replacement where there is no dedicated script language, I can remove the replacement reference and keep the deprecation notice minimal.

Please let me know which you’d prefer, and I’ll update the PR accordingly.

/**
* The "script" language. Provided for compatibility with Maven 3.
* The {@code "script"} language.
* <p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not worth to put a paragraph separator here. They are two very short sentences. It would help keeping generated javadoc a little bit more compact.

@desruisseaux
Copy link
Contributor

I think that redirecting users to RESOURCES is fine.

@anukalp2804
Copy link
Contributor Author

Good point — I’ve removed the paragraph separator and kept the Javadoc more compact. Thanks for the suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants