Class ZipMojo

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

    @Mojo(name="zip",
          requiresDependencyResolution=RUNTIME,
          defaultPhase=PACKAGE,
          requiresProject=true)
    public final class ZipMojo
    extends org.apache.maven.plugin.AbstractMojo
    Creates a zip file.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Boolean attach
      Attach the produced artifact.
      private java.io.File dir
      The root directory of the default FileSet.
      private java.lang.String duplicate
      behavior when a duplicate file is found.
      private java.lang.String excludes
      Comma or space separated list of exclude patterns.
      private java.lang.String extension
      The extension of the generated file.
      private org.apache.tools.ant.types.ZipFileSet[] filesets
      Content to include in the zip.
      private java.lang.String finalName
      The file name of the created zip.
      private java.lang.String includes
      Comma or space separated list of include patterns.
      private java.io.File outputDirectory
      The directory where the zip will be created.
      private org.apache.maven.project.MavenProject project
      The maven project.
      private static java.lang.String PROPERTY_PREFIX
      Parameters property prefix.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Constructor Summary

      Constructors 
      Constructor Description
      ZipMojo()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute()  
      • 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
    • Field Detail

      • PROPERTY_PREFIX

        private static final java.lang.String PROPERTY_PREFIX
        Parameters property prefix.
        See Also:
        Constant Field Values
      • project

        @Parameter(defaultValue="${project}",
                   required=true,
                   readonly=true)
        private org.apache.maven.project.MavenProject project
        The maven project.
      • outputDirectory

        @Parameter(property="gfzip.outputDirectoryoutputDirectory",
                   defaultValue="${project.build.directory}")
        private java.io.File outputDirectory
        The directory where the zip will be created.
      • finalName

        @Parameter(property="gfzip.outputDirectoryfinalName",
                   defaultValue="${project.build.finalName}")
        private java.lang.String finalName
        The file name of the created zip.
      • duplicate

        @Parameter(property="gfzip.outputDirectoryduplicate",
                   defaultValue="add")
        private java.lang.String duplicate
        behavior when a duplicate file is found. Valid values are "add", "preserve", and "fail" ; default value is "add"
      • filesets

        @Parameter(property="gfzip.outputDirectoryfilesets")
        private org.apache.tools.ant.types.ZipFileSet[] filesets
        Content to include in the zip.
      • dir

        @Parameter(property="gfzip.outputDirectorydir",
                   defaultValue="${project.build.directory}")
        private java.io.File dir
        The root directory of the default FileSet. Only when no fileset(s) provided.
      • includes

        @Parameter(property="gfzip.outputDirectoryincludes")
        private java.lang.String includes
        Comma or space separated list of include patterns. all files are included when omitted ; Only when no fileset provided.
      • excludes

        @Parameter(property="gfzip.outputDirectoryexcludes")
        private java.lang.String excludes
        Comma or space separated list of exclude patterns. all files are included when omitted ; Only when no fileset provided.
      • extension

        @Parameter(property="gfzip.outputDirectoryextension",
                   defaultValue="zip")
        private java.lang.String extension
        The extension of the generated file.
      • attach

        @Parameter(property="gfzip.outputDirectoryattach",
                   defaultValue="true")
        private java.lang.Boolean attach
        Attach the produced artifact.
    • Constructor Detail

      • ZipMojo

        public ZipMojo()
    • 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