Class 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 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 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. 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

        private List<File> filesToCompress
        Deprecated.
        The list of files to compress into the site.zip file.
    • 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 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 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.