org.apache.commons.release.plugin.mojos

## Class CommonsSiteCompressionMojo

- java.lang.Object
- - org.apache.maven.plugin.AbstractMojo
  - - org.apache.commons.release.plugin.mojos.CommonsSiteCompressionMojo

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

  Deprecated.
  - as we no longer wish to compress the site, we are going to put this functionality in the `CommonsDistributionStagingMojo`.

      @Deprecated
       @Mojo(name="compress-site",
            defaultPhase=POST_SITE,
            threadSafe=true,
            aggregator=true)
      public class CommonsSiteCompressionMojo
      extends org.apache.maven.plugin.AbstractMojo

  Takes the built `./target/site` directory and compresses it to `./target/commons-release-plugin/site.zip`.
  Since:
    1.0
  Author:
    chtompki

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private org.apache.commons.compress.archivers.zip.ScatterZipOutputStream` | `dirs` Deprecated. A variable for the process of creating the site.zip file.
    `private String` | `distSvnStagingUrl` Deprecated. The url of the subversion repository to which we wish the artifacts to be staged.
    `private List<File>` | `filesToCompress` Deprecated. The list of files to compress into the site.zip file.
    `private Boolean` | `isDistModule` Deprecated. A parameter to generally avoid running unless it is specifically turned on by the consuming module.
    `private org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator` | `scatterZipCreator` Deprecated. A second variable for the process of creating the site.zip file.
    `private File` | `siteDirectory` Deprecated.
    `private File` | `workingDirectory` Deprecated. The working directory for the plugin which, assuming the maven uses the default `${project.build.directory}`, this becomes `target/commons-release-plugin`.

    - ### Fields inherited from interface org.apache.maven.plugin.Mojo

      `ROLE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CommonsSiteCompressionMojo()` Deprecated.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `private void` | `addToZip(File directoryToZip, File file, ZipOutputStream zos)` Deprecated. Given the `directoryToZip` we add the `file` to the zip archive represented by `zos`.
    `void` | `execute()` Deprecated.
    `private void` | `getAllSiteFiles(File siteDirectory, List<File> filesToCompress)` Deprecated. By default this method iterates across the `target/site` directory and adds all of the files to the `filesToCompress` `List`.
    `private void` | `writeZipFile(File outputDirectory, File directoryToZip, List<File> fileList)` Deprecated. A helper method for writing all of the files in our `fileList` to a `site.zip` file in the `workingDirectory`.

    - ### 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

    - #### workingDirectory

          @Parameter(defaultValue="${project.build.directory}/commons-release-plugin",
                     property="commons.outputDirectory")
          private File workingDirectory

      Deprecated.
      The working directory for the plugin which, assuming the maven uses the default `${project.build.directory}`, this becomes `target/commons-release-plugin`.

    - #### siteDirectory

          @Parameter(defaultValue="${project.build.directory}/site",
                     property="commons.siteOutputDirectory")
          private File siteDirectory

      Deprecated.

    - #### distSvnStagingUrl

          @Parameter(defaultValue="",
                     property="commons.distSvnStagingUrl")
          private String distSvnStagingUrl

      Deprecated.
      The url of the subversion repository to which we wish the artifacts to be staged. Typicallly this would need to be of the form: `scm:svn:https://dist.apache.org/repos/dist/dev/commons/foo`. Note. that the prefix to the substring `https` is a requirement.

    - #### isDistModule

          @Parameter(defaultValue="false",
                     property="commons.release.isDistModule")
          private Boolean isDistModule

      Deprecated.
      A parameter to generally avoid running unless it is specifically turned on by the consuming module.

    - #### dirs

          private org.apache.commons.compress.archivers.zip.ScatterZipOutputStream dirs

      Deprecated.
      A variable for the process of creating the site.zip file.

    - #### scatterZipCreator

          private org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator scatterZipCreator

      Deprecated.
      A second variable for the process of creating the site.zip file.

    - #### filesToCompress

          private List<File> filesToCompress

      Deprecated.
      The list of files to compress into the site.zip file.

  - ### Constructor Detail

    - #### CommonsSiteCompressionMojo

          public CommonsSiteCompressionMojo()

      Deprecated.

  - ### Method Detail

    - #### execute

          public void execute()
                       throws org.apache.maven.plugin.MojoExecutionException,
                              org.apache.maven.plugin.MojoFailureException

      Deprecated.
      Throws:
        `org.apache.maven.plugin.MojoExecutionException`
        `org.apache.maven.plugin.MojoFailureException`

    - #### getAllSiteFiles

          private void getAllSiteFiles(File siteDirectory,
                                       List<File> filesToCompress)

      Deprecated.
      By default this method iterates across the `target/site` directory and adds all of the files to the `filesToCompress` `List`.
      Parameters:
        `siteDirectory` - the `File` that represents the `target/site` directory.
        `filesToCompress` - the `List` to which to add all the files.

    - #### writeZipFile

          private void writeZipFile(File outputDirectory,
                                    File directoryToZip,
                                    List<File> fileList)
                             throws IOException

      Deprecated.
      A helper method for writing all of the files in our `fileList` to a `site.zip` file in the `workingDirectory`.
      Parameters:
        `outputDirectory` - is a `File` representing the place to put the site.zip file.
        `directoryToZip` - is a `File` representing the directory of the site (normally `target/site`).
        `fileList` - the list of files to be zipped up, generally generated by `getAllSiteFiles(File, List)`.
      Throws:
        `IOException` - when the copying of the files goes incorrectly.

    - #### addToZip

          private void addToZip(File directoryToZip,
                                File file,
                                ZipOutputStream zos)
                         throws IOException

      Deprecated.
      Given the `directoryToZip` we add the `file` to the zip archive represented by `zos`.
      Parameters:
        `directoryToZip` - a `File` representing the directory from which the file exists that we are compressing. Generally this is `target/site`.
        `file` - a `File` to add to the `ZipOutputStream` `zos`.
        `zos` - the `ZipOutputStream` to which to add our `file`.
      Throws:
        `IOException` - if adding the `file` doesn't work out properly.

Copyright © 2018 The Apache Software Foundation. All rights reserved.