-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Docker publishRegistry in Maven plugin configuration is validated when publish option is false #29756
Comments
As with #29706, you can save us all some time by providing a minimal sample that reproduces the problem. It would also be useful if you shared the build output when the problem occurs. |
@wilkinsona I gave you here already all the needed building blocks ;) |
@cdprete Is there a real-world reason for providing either the username or password alone, instead of always providing neither or both, or is this something you happened up when testing? The plugin is working as designed now, and I'm not sure that ignoring invalid configuration that might not be used is a good idea. I'll label it so the rest of the team can provide opinions on this also. |
@scottfrederick I want to prevent build failures if not all the properties have been provided. Moreover, if I set the plugin to skip the publishing, I assume it should not really care what it's under the In the ideal world, you would have 2 different goals bound to 2 different phases. One for building the image (done on |
The Spring Boot plugin is not a general purpose plugin for Docker operations so we are not going to do that, see #26187. I agree that we should not attempt to validate that part of a plugin configuration is valid if the feature is disabled. I can see now that everything is backed by a |
Hi.
I'm using Spring Boot 2.6.3 and I've the spring-boot-maven-plugin configured in the following way:
where the registry credentials are simply empty as
I've tried to set the
publish
flag dynamically with Groovy in order to set it tofalse
if one of the credentials is missing.Everything works fine if both the credentials are missing. As soon as one is specified, the
publishRegistry
block complains even though thepublish
flag isfalse
.The Groovy part is
Ideally, if the
publish
flag isfalse
, I would expect that the registry is completely ignored since it will not be used anyway.The text was updated successfully, but these errors were encountered: