Skip to content

spring-boot-maven-plugin tags option, multiple issues #33528

@DemianTinkiel

Description

@DemianTinkiel

when creating an image with spring-boot-maven-plugin I encountered the following issues:

  1. Does not accept uppercase for tags, this doesn't allow me to add ${project.version}. Yet this is the default behaviour if tags is not specified. However, specifying tags overrides the behaviour, does not add to it (which is what I interpreted by the documentation by "One or more additional tags to apply to the generated image".)
Execution artifacts-prepare of goal org.springframework.boot:spring-boot-maven-plugin:2.7.3:build-image failed: Unable to parse image reference "3.0.0-SNAPSHOT". Image reference must be in the form '[domainHost:port/][path/]name[:tag][@digest]', with 'path' and 'name' containing only [a-z0-9][.][_][-] -> [Help 1]

  1. Setting as latest generates 2 images - myRepo:8090/group/myproject:latest and latest:latest, both with the same hash
docker images | grep 757bb1ccd2ff
latest                              latest              757bb1ccd2ff   42 years ago    264MB
myRepo:8090/group/myproject         latest              757bb1ccd2ff   42 years ago    264MB

for issue 1, my pom is

<plugin>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-maven-plugin</artifactId>
  <version>2.7.3</version>
  <configuration>
    <docker>
      <publishRegistry>
        <url>${image.repo.url}</url>
        <username>${image.repo.user}</username>
        <password>${image.repo.pass}</password>
      </publishRegistry>
    </docker>
    <image>
      <name>${image.prefix}/${project.artifactId}</name>
      <tags>latest,${project.version}</tags>
    </image>
  </configuration>
  <executions>
    <execution>
      <id>artifacts-prepare</id>
      <goals>
        <goal>build-image</goal>
      </goals>
    </execution>
  </executions>
</plugin>

for issue 2 the pom is the same but with <tags>latest</tags>

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions