Package nl.lexemmens.podman
Class AbstractPodmanMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- nl.lexemmens.podman.AbstractPodmanMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractCatalogSupport,BuildMojo,CleanMojo,SaveMojo
public abstract class AbstractPodmanMojo extends org.apache.maven.plugin.AbstractMojo
-
-
Field Summary
Fields Modifier and Type Field Description protected BatchImageConfigurationbatchBatch Image Configuration: 1 configuration to n images.protected static StringCATALOG_ARTIFACT_NAMEprotected static StringCATALOG_HEADERprotected 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 executionprotected SkopeoConfigurationskopeo
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPodmanMojo()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 pushRegistryprotected voidinitImageConfigurations()protected booleanrequireImageConfiguration()Returns whether the image configuration should be initializedprotected List<String>singleImageConfigurationToFullImageList(SingleImageConfiguration singleImageConfiguration)protected abstract booleanskipGoal()Check if the execution of the mojo should be skipped
-
-
-
Field Detail
-
PODMAN_DIRECTORY
protected static final String PODMAN_DIRECTORY
- See Also:
- Constant Field Values
-
CATALOG_ARTIFACT_NAME
protected static final String CATALOG_ARTIFACT_NAME
- See Also:
- Constant Field Values
-
CATALOG_HEADER
protected static final String CATALOG_HEADER
- 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
-
skopeo
@Parameter protected SkopeoConfiguration skopeo
-
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
-
-
Method Detail
-
execute
public final void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
initImageConfigurations
protected final void initImageConfigurations() 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
-
skipGoal
protected abstract boolean skipGoal()
Check if the execution of the mojo should be skipped- Returns:
- whether the mojo should be skipped
-
requireImageConfiguration
protected boolean requireImageConfiguration()
Returns whether the image configuration should be initialized- Returns:
- image configuration must be initialized
-
singleImageConfigurationToFullImageList
protected List<String> singleImageConfigurationToFullImageList(SingleImageConfiguration singleImageConfiguration)
-
-