Skip to content

Maven properties that are flagged read-only for command-line binding lead to warnings with Maven 4 #43699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
snicoll opened this issue Jan 6, 2025 · 4 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented Jan 6, 2025

See #43596

Some of our Mojos have a POJO structure for some of the parameters. For instance, the spring-boot:build-image goal as an <image> property that contains sub-properties such as name and the like.

Maven does not allow to bind a property of a POJO from the command line. To workaround this issue, the only way we found was to declare the parameter again, but flag it read-only so that it doesn't show up in auto-completion.

Maven 4 now makes use of that read-only flag and outputs a warning. We need to figure out what to do to preserve the current behavior.

@snicoll snicoll added type: enhancement A general enhancement status: pending-design-work Needs design work before any code can be developed labels Jan 6, 2025
@snicoll snicoll added this to the 3.5.x milestone Jan 6, 2025
@mpalourdio

This comment was marked as off-topic.

@philwebb

This comment was marked as resolved.

@mpalourdio

This comment was marked as resolved.

@mhalbritter
Copy link
Contributor

This warning pops up on Maven 3.9.9, too.

IntelliJ doesn't care about the readonly flag at all. It auto-suggests, when typing "image":

  • image (readonly = false)
  • imageName (readonly = true)
  • imageBuilder (readonly = true)
  • imagePlatform (readonly = true)
  • runImage (readonly = true)

So from an IntelliJ auto-complete standpoint we can remove the readonly flags.

However, using mvn help:describe -Dplugin=org.springframework.boot:spring-boot-maven-plugin -Ddetail shows:

    image
      Image configuration, with {@code builder}, {@code runImage}, {@code
      name}, {@code env}, {@code cleanCache}, {@code verboseLogging}, {@code
      pullPolicy}, and {@code publish} options.

and no imageName, imageBuilder etc. So it doesn't show readonly = true @Parameters to the user.

I investigated a bit but couldn't find a different way to get the Image POJO to be bound.

@mhalbritter mhalbritter self-assigned this Mar 18, 2025
@mhalbritter mhalbritter removed the status: pending-design-work Needs design work before any code can be developed label Mar 18, 2025
@mhalbritter mhalbritter modified the milestones: 3.5.x, 3.5.0-M3 Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants