Class ProductArchiverMojo

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

    @Mojo(name="archive-products",
          defaultPhase=PACKAGE,
          threadSafe=true)
    public final class ProductArchiverMojo
    extends AbstractProductMojo

    Creates archives with the product installations.

    • Field Detail

      • LOCK

        private static final java.lang.Object LOCK
      • DEFAULT_ARCHIVE_FORMAT

        private static final java.lang.String DEFAULT_ARCHIVE_FORMAT
        See Also:
        Constant Field Values
      • TAR_GZ_ARCHIVE_FORMAT

        private static final java.lang.String TAR_GZ_ARCHIVE_FORMAT
        See Also:
        Constant Field Values
      • TGZ_ARCHIVE_FORMAT

        private static final java.lang.String TGZ_ARCHIVE_FORMAT
        See Also:
        Constant Field Values
      • formats

        @Parameter
        private java.util.Map<java.lang.String,​java.lang.String> formats

        Maps os to format. By default a zip file will be created. For example, the following configuration will create tar.gz product archives for Linux

         <formats>
           <linux>tar.gz</linux>
         </formats>
         
        Supported formats
        • zip
        • tar.gz

      • zipArchiver

        @Component(role=org.codehaus.plexus.archiver.Archiver.class,
                   hint="zip")
        private org.codehaus.plexus.archiver.Archiver zipArchiver
      • tarArchiver

        @Component(role=org.codehaus.plexus.archiver.Archiver.class,
                   hint="tar")
        private org.codehaus.plexus.archiver.tar.TarArchiver tarArchiver
      • helper

        @Component
        private org.apache.maven.project.MavenProjectHelper helper
    • Constructor Detail

      • ProductArchiverMojo

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

        private void createCommonsCompressTarGz​(java.io.File productArchive,
                                                java.io.File sourceDir)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • getArchiveFormat

        private java.lang.String getArchiveFormat​(TargetEnvironment env)
      • getArchiveFileName

        static java.lang.String getArchiveFileName​(Product product)
      • getArtifactClassifier

        static java.lang.String getArtifactClassifier​(Product product,
                                                      TargetEnvironment environment)