Class PackageMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    public class PackageMojo
    extends AbstractCargoMojo
    Package a container distribution, a Configuration and deployed deployables. See Packager.
    Since:
    Maven2 Cargo Plugin v0.3
    • Constructor Detail

      • PackageMojo

        public PackageMojo()
    • Method Detail

      • setPackagerElement

        protected void setPackagerElement​(Packager packagerElement)
        Parameters:
        packagerElement - the Packager configuration defined by the user
        See Also:
        getPackagerElement()
      • doExecute

        public void doExecute()
                       throws org.apache.maven.plugin.MojoExecutionException
        Executes the plugin.

        This method must be implemented by all Mojos extending this class. The reason for this pattern is because we want the AbstractCargoMojo.execute() method to always be called so that necessary plugin initialization can be performed. Without this pattern Mojos extending this class could "forget" to call super.execute() thus leading to unpredictible results.

        Specified by:
        doExecute in class AbstractCargoMojo
        Throws:
        org.apache.maven.plugin.MojoExecutionException - in case of error
      • createPackager

        protected Packager createPackager​(Container container)
                                   throws org.apache.maven.plugin.MojoExecutionException
        Create the packager.
        Parameters:
        container - Container to use.
        Returns:
        Packager for the container and the Maven2 packager element.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - If anything goes wrong.