Package nl.lexemmens.podman
Class AbstractPodmanMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- nl.lexemmens.podman.AbstractPodmanMojo
-
-
Field Summary
Fields Modifier and Type Field Description protected BatchImageConfigurationbatchBatch Image Configuration: 1 configuration to n images.protected booleanfailOnMissingContainerfileWhen set to false, the plugin wil not throw an exception if a Containerfile cannot be found.protected List<SingleImageConfiguration>imagesSingle Image configuration: 1 configuration to 1 imageprotected PodmanConfigurationpodmanPodman specific configurationprotected static StringPODMAN_DIRECTORYprotected org.apache.maven.project.MavenProjectprojectThe Maven projectprotected StringpushRegistryThe registry of the container imagesprotected String[]registriesAll the source registries that are required to build and push container images.protected List<SingleImageConfiguration>resolvedImagesprotected org.apache.maven.settings.SettingssettingsHolds the authentication data from Maven.protected booleanskipSkip all podman stepsprotected booleanskipAuthSkip authentication prior to execution
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPodmanMojo()Constructor.protectedAbstractPodmanMojo(boolean requireImageConfiguration)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckAuthentication(ServiceHub hub)voidexecute()abstract voidexecuteInternal(ServiceHub hub)Executes this Mojo internally.protected StringgetFullImageNameWithPushRegistry(String imageNameWithTag)If the pushRegistry property is set, this method prepends the image name with the value of the pushRegistry
-
-
-
Field Detail
-
PODMAN_DIRECTORY
protected static final String PODMAN_DIRECTORY
- See Also:
- Constant Field Values
-
project
@Parameter(defaultValue="${project}", required=true, readonly=true) protected org.apache.maven.project.MavenProject projectThe Maven project
-
settings
@Parameter(defaultValue="${settings}", readonly=true) protected org.apache.maven.settings.Settings settingsHolds 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
-
images
@Parameter protected List<SingleImageConfiguration> images
Single Image configuration: 1 configuration to 1 image
-
batch
@Parameter protected BatchImageConfiguration batch
Batch Image Configuration: 1 configuration to n images.
-
podman
@Parameter protected PodmanConfiguration podman
Podman specific configuration
-
skipAuth
@Parameter(property="podman.skip.auth", defaultValue="false") protected boolean skipAuthSkip authentication prior to execution
-
skip
@Parameter(property="podman.skip", defaultValue="false") protected boolean skipSkip all podman steps
-
failOnMissingContainerfile
@Parameter(property="podman.fail.on.missing.containerfile", defaultValue="true") protected boolean failOnMissingContainerfileWhen 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.
-
resolvedImages
protected final List<SingleImageConfiguration> resolvedImages
-
-
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- AServiceHubinstance providing access to relevant services- Throws:
org.apache.maven.plugin.MojoExecutionException- In case anything happens during execution which prevents execution from continuing
-
-