Package org.imixs.maven.manik
Class MojoAutodeployPlugin
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.imixs.maven.manik.MojoAutodeployPlugin
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="deploy", defaultPhase=INSTALL, threadSafe=true) public class MojoAutodeployPlugin extends org.apache.maven.plugin.AbstractMojoThe Imixs Manik Autodeploy Plugin runs during the LifecyclePhase INSTALL on the goal 'deploy'. This goal can be used to autodeploy an artifact into a target directory (e.g. the Autodeploy folder of an application server).Plugin configuration example:
You can also use complex wildcard patterns like<autodeployments> <deployment> <!-- wildcard deployment --> <source>target/*.war</source> <target>docker/deployments</target> </deployment> </autodeployments>target/*.{war,ear,jar}The target must be an existing directory.
- Author:
- rsoika
-
-
Field Summary
Fields Modifier and Type Field Description protected List<AutoDeployment>autodeployments
-
Constructor Summary
Constructors Constructor Description MojoAutodeployPlugin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyArtefact(Path path, Path targetPath, boolean unpack)This method copies a single artifact.voidexecute()static PathgetSourcePath(AbstractDeployment deployment, Path basePath)Computes the source path of a deployment objectstatic PathgetTargetPath(AbstractDeployment deployment, Path basePath)Computes the target path of a deployment object
-
-
-
Field Detail
-
autodeployments
@Parameter(property="autodeployments", alias="hotdeploy.autodeployments", required=true) protected List<AutoDeployment> autodeployments
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
getSourcePath
public static Path getSourcePath(AbstractDeployment deployment, Path basePath)
Computes the source path of a deployment object- Parameters:
deployment-basePath-- Returns:
-
getTargetPath
public static Path getTargetPath(AbstractDeployment deployment, Path basePath)
Computes the target path of a deployment object- Parameters:
deployment-basePath-- Returns:
-
copyArtefact
public void copyArtefact(Path path, Path targetPath, boolean unpack) throws IOException
This method copies a single artifact. If the path is a directory, the method prints a warning and skips the artifact.If the param 'unpack' is true then the method tries to unzip the artifact.
- Throws:
IOException
-
-