Class ImageNameHelper


  • public class ImageNameHelper
    extends Object
    Helper class to format image names.

    Supported formatter options:

    • %a: Results in the artifactId (sanitized)
    • %d: Results in the directory that contains the Containerfile
    • %g: Results in the last part of the groupId (after the last .)
    • %n: Results in a number (starting at 0)
    • %l: Results in 'latest' in case the current version is a SNAPSHOT. Otherwise version of the project
    • %t: Results in 'snapshot-[timestamp]'
    • %v: Results in the version of the project
    • Constructor Detail

      • ImageNameHelper

        public ImageNameHelper​(org.apache.maven.project.MavenProject mavenProject)
        Constructs a new instance of this ImageNameHelper
        Parameters:
        mavenProject - The MavenProject to use
    • Method Detail

      • formatImageName

        public void formatImageName​(SingleImageConfiguration imageConfiguration)
        Formats the imageName according to the specifications from this class. Both image names as specified in the 'name' tag and the 'imageName' tag (part of the stage section) are being proessed.
        Parameters:
        imageConfiguration - The imageConfiguration containing the image names to format.