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 @Mojo(name="compress-site", defaultPhase=POST_SITE, threadSafe=true, aggregator=true) public final class CommonsSiteCompressionMojo extends org.apache.maven.plugin.AbstractMojo
Deprecated.
As we no longer wish to compress the site, we are going to put this functionality in the CommonsDistributionStagingMojo.
Takes the built ./target/site directory and compresses it to ./target/commons-release-plugin/site.zip.
Since:
1.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private String
    Deprecated.
    The URL of the Subversion repository to which we wish the artifacts to be staged.
    private List<File>
    Deprecated.
    The list of files to compress into the site.zip file.
    private Boolean
    Deprecated.
    A parameter to generally avoid running unless it is specifically turned on by the consuming module.
    private File
    Deprecated.
    The site output directory.
    private File
    Deprecated.
    The working directory for the plugin, which is target/commons-release-plugin when Maven uses the default ${project.build.directory}.

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

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
    Constructs a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    addToZip(File directoryToZip, File file, ZipOutputStream zos)
    Deprecated.
    Adds the file from directoryToZip to the ZIP archive represented by zos.
    void
    Deprecated.
     
    private void
    getAllSiteFiles(File siteDirectory, List<File> filesToCompress)
    Deprecated.
    Gets all site files and adds them to the filesToCompress List.
    private void
    writeZipFile(File outputDirectory, File directoryToZip, List<File> fileList)
    Deprecated.
    Writes all the files in 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 Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • workingDirectory

      @Parameter(defaultValue="${project.build.directory}/commons-release-plugin", property="commons.outputDirectory") private File workingDirectory
      Deprecated.
      The working directory for the plugin, which is target/commons-release-plugin when Maven uses the default ${project.build.directory}.
    • siteDirectory

      @Parameter(defaultValue="${project.build.directory}/site", property="commons.siteOutputDirectory") private File siteDirectory
      Deprecated.
      The site output directory.
    • 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. Typically 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.
    • filesToCompress

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

  • Method Details

    • addToZip

      private void addToZip(File directoryToZip, File file, ZipOutputStream zos) throws IOException
      Deprecated.
      Adds the file from directoryToZip to the ZIP archive represented by zos.
      Parameters:
      directoryToZip - A File representing the directory containing the file to compress. 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 - Thrown if an error occurs while adding the file to the ZIP archive.
    • 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.
      Gets all site files and adds them to the filesToCompress List. This method searches the target/site directory by default.
      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.
      Writes all the files in 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 - Thrown if an error occurs while copying the files.