Class AbstractPodmanMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
    Direct Known Subclasses:
    BuildMojo, CleanMojo, PushMojo, SaveMojo

    public abstract class AbstractPodmanMojo
    extends org.apache.maven.plugin.AbstractMojo
    • Field Detail

      • project

        @Parameter(defaultValue="${project}",
                   required=true,
                   readonly=true)
        protected org.apache.maven.project.MavenProject project
        The Maven project
      • settings

        @Parameter(defaultValue="${settings}",
                   readonly=true)
        protected org.apache.maven.settings.Settings settings
        Holds the authentication data from Maven.
      • registries

        @Parameter(property="podman.registries")
        protected String[] registries
        All the source registries that are required to build and push container images. Note that the target registry must be explicitly set!
      • pushRegistry

        @Parameter(property="podman.push.registry")
        protected String pushRegistry
        The registry of the container images
      • batch

        @Parameter
        protected BatchImageConfiguration batch
        Batch Image Configuration: 1 configuration to n images.
      • skipAuth

        @Parameter(property="podman.skip.auth",
                   defaultValue="false")
        protected boolean skipAuth
        Skip authentication prior to execution
      • skip

        @Parameter(property="podman.skip",
                   defaultValue="false")
        protected boolean skip
        Skip all podman steps
      • failOnMissingContainerfile

        @Parameter(property="podman.fail.on.missing.containerfile",
                   defaultValue="true")
        protected boolean failOnMissingContainerfile
        When set to false, the plugin wil not throw an exception if a Containerfile cannot be found. Instead plugin execution will be skipped and a warning is logged.
    • Constructor Detail

      • AbstractPodmanMojo

        protected AbstractPodmanMojo()
        Constructor. Initializes this abstract class with a concrete base class
      • AbstractPodmanMojo

        protected AbstractPodmanMojo​(boolean requireImageConfiguration)
        Constructor. Initializes this abstract class with a concrete base class
        Parameters:
        requireImageConfiguration - Whether initialization of the configuration should be skipped
    • Method Detail

      • execute

        public final void execute()
                           throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • checkAuthentication

        protected void checkAuthentication​(ServiceHub hub)
                                    throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getFullImageNameWithPushRegistry

        protected String getFullImageNameWithPushRegistry​(String imageNameWithTag)

        If the pushRegistry property is set, this method prepends the image name with the value of the pushRegistry

        Parameters:
        imageNameWithTag - The image name with tag, such as repository/some/image:1.0.0
        Returns:
        The tull image name with the push registry, such as: registry.example.com/repository/some/image:1.0.0
      • executeInternal

        public abstract void executeInternal​(ServiceHub hub)
                                      throws org.apache.maven.plugin.MojoExecutionException
        Executes this Mojo internally.
        Parameters:
        hub - A ServiceHub instance providing access to relevant services
        Throws:
        org.apache.maven.plugin.MojoExecutionException - In case anything happens during execution which prevents execution from continuing