-
Notifications
You must be signed in to change notification settings - Fork 40.7k
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
Add documentation tip showing how to configure publishRegistry maven properties from the command line #31024
Comments
I'm not sure how easy this will be to fix. I suspect that we can't just add a In the meantime, you can probably do something like this: <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<name>${docker.image.prefix}/${project.artifactId}:${project.version}</name>
</image>
<docker>
<publishRegistry>
<username>${spring-boot.build-image.publishRegistry.username}</username>
<password>${spring-boot.build-image.publishRegistry.password}</password>
<url>${spring-boot.build-image.publishRegistry.url}</url>
</publishRegistry>
</docker>
</configuration>
<executions>
<execution>
<goals>
<goal>build-image</goal>
</goals>
</execution>
</executions>
</plugin> |
It's indeed not possible to map a nested parameter unless we create a parameter for the sole purpose to be mapped. This is one of the downsides of using such structure with Maven plugins. I don't think we should expose the parameters and users should rather define a property that suits their needs using either the suggestion above, or using a profile. |
I agree with @snicoll, as Maven makes it simple enough to create your own properties and use them in the plugin configuration. |
I too agree with @snicoll. We've already seen some examples of users defining their own properties such as this from <configuration>
<image>
<name>${docker.image-name}</name>
</image>
<docker>
<publishRegistry>
<username>${docker.credentials.username}</username>
<password>${docker.credentials.password}</password>
</publishRegistry>
</docker>
</configuration> This feels like the right way to go to me. |
Thanks everyone. I'm going to repurpose this one as documentation issue. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Closing in favor of #34517 |
If I have a private registry and I want to publish the generated docker image I need to provide
username
,password
, andurl
in the mavenpom.xml
.I would like to be able to send this variables over the command line as follows:
Currently the following variables doesnt exist for the command line:
-Dspring-boot.build-image.publishRegistry.username
-Dspring-boot.build-image.publishRegistry.password
Dspring-boot.build-image.publishRegistry.url
I believe they should be created here:
https://github.com/spring-projects/spring-boot/blob/82b90d57496ba85be316b9eb88a36d81f2cc9baa/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/BuildImageMojo.java
The text was updated successfully, but these errors were encountered: