Class AbstractOsgiDockerMojo

    • Field Detail

      • buildDocker

        @Parameter(defaultValue="false")
        protected boolean buildDocker
        Allows the generation of a docker image.
      • dockerClassifier

        @Parameter(defaultValue="docker-info",
                   property="dockerfile.classifier")
        protected String dockerClassifier
        Classifier to use when attaching the Docker info JAR. If empty or absent, the JAR will become the main artifact of the project.
      • connectTimeoutMillis

        @Parameter(defaultValue="300000",
                   property="dockerfile.connectTimeoutMillis",
                   required=true)
        protected long connectTimeoutMillis
      • dockerConfigFile

        @Parameter(property="dockerfile.dockerConfigFile")
        protected File dockerConfigFile
        Path to docker config file, if the default is not acceptable.
      • dockerInfoDirectory

        @Parameter(defaultValue="${project.build.directory}/docker",
                   property="dockerfile.dockerInfoDirectory",
                   required=true)
        protected File dockerInfoDirectory
        Directory where various Docker-related metadata fragments will be stored.
      • password

        @Parameter(property="dockerfile.password")
        protected String password
      • readTimeoutMillis

        @Parameter(defaultValue="300000",
                   property="dockerfile.readTimeoutMillis",
                   required=true)
        protected long readTimeoutMillis
      • retryCount

        @Parameter(defaultValue="1",
                   property="dockerfile.retryCount")
        protected int retryCount
        Certain Docker operations can fail due to mysterious Docker daemon conditions. Sometimes it might be worth it to just retry operations until they succeed. This parameter controls how many times operations should be retried before they fail. By default, an extra attempt (so up to two attempts) is made before failing.
      • testOutputDirectory

        @Parameter(defaultValue="${project.build.testOutputDirectory}",
                   property="dockerfile.testOutputDirectory",
                   required=true)
        protected File testOutputDirectory
        Directory where test metadata will be written during build.
      • useMavenSettingsForAuth

        @Parameter(defaultValue="false",
                   property="dockerfile.useMavenSettingsForAuth")
        protected boolean useMavenSettingsForAuth
        A maven server id, in order to use maven settings to supply server auth.
      • useProxy

        @Parameter(defaultValue="true",
                   property="dockerfile.useProxy")
        protected boolean useProxy
        Whether to connect to Docker Daemon using HTTP proxy, if set.
      • username

        @Parameter(property="dockerfile.username")
        protected String username
    • Constructor Detail

      • AbstractOsgiDockerMojo

        protected AbstractOsgiDockerMojo​(org.apache.maven.project.MavenProject pProject)
    • Method Detail

      • buildDockerInfoJar

        @Nonnull
        protected File buildDockerInfoJar​(@Nonnull
                                          org.apache.maven.plugin.logging.Log log)
                                   throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • ensureDockerInfoDirectory

        @Nonnull
        protected File ensureDockerInfoDirectory()
                                          throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • execute

        protected abstract void execute​(com.spotify.docker.client.DockerClient dockerClient)
                                 throws org.apache.maven.plugin.MojoExecutionException,
                                        org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • executeMojo

        public void executeMojo()
                         throws org.apache.maven.plugin.MojoExecutionException,
                                org.apache.maven.plugin.MojoFailureException
        Overrides:
        executeMojo in class br.com.c8tech.tools.maven.osgi.lib.mojo.AbstractCustomPackagingMojo
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • writeImageInfo

        protected void writeImageInfo​(String repository,
                                      String tag)
                               throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • writeMetadata

        protected void writeMetadata​(org.apache.maven.plugin.logging.Log log)
                              throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException