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.
    • contextPath

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

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

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

      protected File localRepositoryDirectory
      Stores the local repository directory.
    • piranhaJarFile

      protected File piranhaJarFile
      Stores the Piranha JAR file.
    • runtimeDirectory

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

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

      @Parameter(defaultValue="${project.build.finalName}", 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.
    • getPiranhaJarFile

      protected void getPiranhaJarFile() throws IOException
      Get the Piranha distribution JAR file.
      Throws:
      IOException - when an I/O error occurs.