java.lang.Object
org.apache.maven.plugin.AbstractMojo
cloud.piranha.maven.plugins.piranha.BaseMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
RunMojo, StartMojo

public abstract class BaseMojo extends org.apache.maven.plugin.AbstractMojo
The base Mojo for the start and run goals.
Author:
Manfred Riem ([email protected])
  • Field Details

    • UNABLE_TO_CREATE_DIRECTORIES

      protected static final String UNABLE_TO_CREATE_DIRECTORIES
      Stores the 'Unable to create directories' message.
      See Also:
    • buildDirectory

      @Parameter(defaultValue="${project.build.directory}", required=true, readonly=true) protected String buildDirectory
      Stores the build directory.
    • distribution

      @Parameter(defaultValue="coreprofile", property="piranha.distribution", required=false) protected String distribution
      Stores the distribution to use.
    • contextPath

      @Parameter(required=false, property="piranha.contextPath") protected String contextPath
      Stores the context path.
    • httpPort

      @Parameter(defaultValue="8080", property="piranha.httpPort", required=false) protected Integer httpPort
      Stores the HTTP port.
    • jvmArguments

      @Parameter(required=false, property="piranha.jvmArguments") protected String jvmArguments
      Stores the JVM arguments.
    • localRepositoryDirectory

      protected File localRepositoryDirectory
      Stores the local repository directory.
    • piranhaFile

      protected File piranhaFile
      Stores the Piranha JAR/Zip file.
    • piranhaType

      protected String piranhaType
      Stores the Piranha type (jar or zip).
    • runtimeDirectory

      @Parameter(defaultValue="${project.build.directory}/piranha", property="piranha.runtimeDirectory", required=true) protected String runtimeDirectory
      Stores the runtime directory.
    • version

      @Parameter(property="piranha.version", required=false) protected String version
      Stores the version of the Piranha runtime to use.
    • warName

      @Parameter(defaultValue="${project.build.finalName}", property="piranha.warName", required=true, readonly=true) protected String warName
      Stores the WAR name.
  • Constructor Details

    • BaseMojo

      public BaseMojo()
  • Method Details

    • convertGroupIdToPath

      protected String convertGroupIdToPath(String groupId)
      Convert a Maven groupId to a path snippet.
      Parameters:
      groupId - the groupId.
      Returns:
      the path.
    • createArtifactPath

      protected String createArtifactPath(String groupId, String artifactId, String version, String type)
      Create an artifact path from a groupId, artifactId, version and type.
      Parameters:
      groupId - the groupId.
      artifactId - the artifactId.
      version - the version
      type - the type.
      Returns:
      the artifact path.
    • createMavenCentralArtifactUrl

      protected URL createMavenCentralArtifactUrl(String groupId, String artifactId, String version, String type) throws IOException
      Create the Maven central artifact URL
      Parameters:
      groupId - the groupId.
      artifactId - the artifactId.
      version - the version
      type - the type.
      Returns:
      the URL.
      Throws:
      IOException - when an I/O error occurs.
    • determineVersionToUse

      protected void determineVersionToUse()
      Determine what version of Piranha to use.
    • copyWarFile

      protected void copyWarFile() throws IOException
      Copy the WAR file.
      Throws:
      IOException - when an I/O error occurs.
    • downloadDistribution

      protected void downloadDistribution() throws IOException
      Download the Piranha distribution.
      Throws:
      IOException - when an I/O error occurs.
    • extractDistribution

      protected void extractDistribution()
      Extract the distribution.