Class BaseMojo
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
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 Summary
Modifier and TypeFieldDescriptionprotected String
Stores the build directory.protected String
Stores the context path.protected String
Stores the distribution to use.protected Integer
Stores the HTTP port.protected String
Stores the JVM arguments.protected File
Stores the local repository directory.protected File
Stores the Piranha JAR/Zip file.protected String
Stores the Piranha type (jar or zip).protected String
Stores the runtime directory.protected static final String
Stores the 'Unable to create directories' message.protected String
Stores the version of the Piranha runtime to use.protected String
Stores the WAR name.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
convertGroupIdToPath
(String groupId) Convert a Maven groupId to a path snippet.protected void
Copy the WAR file.protected String
createArtifactPath
(String groupId, String artifactId, String version, String type) Create an artifact path from a groupId, artifactId, version and type.protected URL
createMavenCentralArtifactUrl
(String groupId, String artifactId, String version, String type) Create the Maven central artifact URLprotected void
Determine what version of Piranha to use.protected void
Download the Piranha distribution.protected void
Extract the distribution.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
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
-
Field Details
-
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 buildDirectoryStores the build directory. -
distribution
@Parameter(defaultValue="coreprofile", property="piranha.distribution", required=false) protected String distributionStores the distribution to use. -
contextPath
Stores the context path. -
httpPort
@Parameter(defaultValue="8080", property="piranha.httpPort", required=false) protected Integer httpPortStores the HTTP port. -
jvmArguments
Stores the JVM arguments. -
localRepositoryDirectory
Stores the local repository directory. -
piranhaFile
Stores the Piranha JAR/Zip file. -
piranhaType
Stores the Piranha type (jar or zip). -
runtimeDirectory
@Parameter(defaultValue="${project.build.directory}/piranha", property="piranha.runtimeDirectory", required=true) protected String runtimeDirectoryStores the runtime directory. -
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 warNameStores the WAR name.
-
-
Constructor Details
-
BaseMojo
public BaseMojo()
-
-
Method Details
-
convertGroupIdToPath
Convert a Maven groupId to a path snippet.- Parameters:
groupId
- the groupId.- Returns:
- the path.
-
createArtifactPath
Create an artifact path from a groupId, artifactId, version and type.- Parameters:
groupId
- the groupId.artifactId
- the artifactId.version
- the versiontype
- 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 versiontype
- 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
Copy the WAR file.- Throws:
IOException
- when an I/O error occurs.
-
downloadDistribution
Download the Piranha distribution.- Throws:
IOException
- when an I/O error occurs.
-
extractDistribution
protected void extractDistribution()Extract the distribution.
-