Class BuildMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.eolang.hone.BuildMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="build", defaultPhase=GENERATE_RESOURCES, requiresProject=false) public final class BuildMojo extends org.apache.maven.plugin.AbstractMojo
Build Docker image.

This goal must be used only if you want to build a local custom Docker image for your project. This may be useful when you don't have network access to Docker Hub. In most cases, you have it and that's why don't need this goal. Instead, just use the pull goal, which will simply pull a required Docker image from the Hub.

This goal is mostly for testing and CI/CD.

Since:
0.1.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    Run without Docker even if phino is available.
    protected String
    Docker image to use.
    protected boolean
    Whether to use "sudo" when executing Docker commands.
    protected File
    The "target/" directory of Maven project.
    protected org.eolang.hone.Timings
    Timings tracker for performance measurements.

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    final void
     

    Methods inherited from class org.apache.maven.plugin.AbstractMojo

    getLog, getPluginContext, setLog, setPluginContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • target

      @Parameter(property="hone.target", defaultValue="${project.build.directory}") protected File target
      The "target/" directory of Maven project.
      Since:
      0.1.0
    • timings

      protected org.eolang.hone.Timings timings
      Timings tracker for performance measurements.
      Since:
      0.1.0
    • image

      @Parameter(property="hone.image", defaultValue="yegor256/hone:0.20.3") protected String image
      Docker image to use.
      Since:
      0.1.0
    • sudo

      @Parameter(property="hone.sudo", defaultValue="false") protected boolean sudo
      Whether to use "sudo" when executing Docker commands.
      Since:
      0.1.0
    • alwaysWithDocker

      @Parameter(property="hone.always-with-docker", defaultValue="false") protected boolean alwaysWithDocker
      Run without Docker even if phino is available.

      If this is set to true, Docker is used even if phino is available. It is recommended to keep this parameter to false, thus making the build faster if it's possible.

      Since:
      0.17.0
      Suppressed Checkstyle violations:
      MemberNameCheck (6 lines)
  • Constructor Details

    • BuildMojo

      public BuildMojo()
  • Method Details

    • exec

      public void exec() throws IOException
      Throws:
      IOException
    • execute

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