Skip to content

Support String array for @Parameter's element "defaultValues" - #1273

Open
kwin wants to merge 3 commits into
masterfrom
feature/support-string-array-default-values-on-parameter-annotation
Open

kwin wants to merge 3 commits into
masterfrom
feature/support-string-array-default-values-on-parameter-annotation

Conversation

@kwin

@kwin kwin commented Nov 9, 2026

Copy link
Copy Markdown
Member

Convert multi-value Strings into a comma-separated String of org.apache.maven.plugin.descriptor.Parameter#defaultValue

The underlying Sisu implementaton supports comma separated Strings for collections
(https://eclipse.dev/sisu/org.eclipse.sisu.plexus/configuration.html#Collection_Objects). as well as the Maven 4 equivalent at V4MojoConfigurator.class.

This closes #1272


To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
check one of the following:

@kwin
kwin force-pushed the feature/support-string-array-default-values-on-parameter-annotation branch from 9e83359 to 7e19fd5 Compare November 13, 2026 18:26
@kwin kwin changed the title Support String array for @Parameter's element "defaultValue" Support String array for @Parameter's element "defaultValues" Nov 13, 2026
Convert multi-value Strings into a comma-separated String of
org.apache.maven.plugin.descriptor.Parameter#defaultValue

The underlying Sisu implementaton supports comma separated Strings for
collections
(https://eclipse.dev/sisu/org.eclipse.sisu.plexus/configuration.html#Collection_Objects).
as well as the Maven 4 equivalent at V4MojoConfigurator.class.
The old single-value defaultValue is still supported, but for multi-value defaults, use defaultValues instead.

This closes #1272
@kwin
kwin force-pushed the feature/support-string-array-default-values-on-parameter-annotation branch from 7e19fd5 to bccf6f7 Compare November 13, 2026 18:32
@kwin
kwin marked this pull request as ready for review November 13, 2026 18:33

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: COMMENT — Functionally sound enhancement. The null-based mutual-exclusion logic is correct (ASM only visits explicitly-set annotation attributes, so ParameterAnnotationContent fields default to null for unspecified attributes — the conflict check works correctly even with the annotation interface defaults of "" and {}). Two observations worth addressing:

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed the defaultValues support addition to @Parameter. Three minor documentation and style issues found.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Following up on my earlier reviews — all previously raised issues have been addressed in the latest commits.

  • ✅ #Collection_Objects? trailing ? in Sisu link — fixed
  • ✅ "Mojo API" link label for JSR 330 — corrected to "JSR 330"
  • ✅ /** ... */ Javadoc syntax used for inline comment — converted to //
  • ✅ Comma restriction documented in defaultValues() Javadoc (noted since first review)
  • ✅ Queue and Deque coverage in isCollection() — already present in the implementation

LGTM. No remaining issues.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

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.

Support String[] for default values on @Parameter annotation

4 participants