Class 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.AbstractMojo
    The 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:

     		
    	<autodeployments>
    		<deployment>
    			<!-- wildcard deployment -->
    			<source>target/*.war</source>
    			<target>docker/deployments</target>
    		</deployment>
    	</autodeployments>
      
     
    You can also use complex wildcard patterns like
     target/*.{war,ear,jar}
     

    The target must be an existing directory.

    Author:
    rsoika
    • Field Detail

      • autodeployments

        @Parameter(property="autodeployments",
                   alias="hotdeploy.autodeployments",
                   required=true)
        protected List<AutoDeployment> autodeployments
    • Constructor Detail

      • MojoAutodeployPlugin

        public MojoAutodeployPlugin()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.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