Class AbstractProductMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
    Direct Known Subclasses:
    DirectorMojo, ProductArchiverMojo

    abstract class AbstractProductMojo
    extends org.apache.maven.plugin.AbstractMojo
    • Field Detail

      • project

        @Parameter(property="project",
                   readonly=true)
        private org.apache.maven.project.MavenProject project
      • session

        @Parameter(property="session",
                   readonly=true)
        private org.apache.maven.execution.MavenSession session
      • products

        @Parameter
        private java.util.List<Product> products

        Selection of products to be installed and configuration per product.

        If the project contains more than one product file, you need to choose for which ones you want to create distribution archives. If you choose to install more than one product, you need to specify the attachId (which becomes a part of the classifier) to make the classifiers unique. Example:

         <plugin>
           <groupId>org.eclipse.tycho</groupId>
           <artifactId>tycho-p2-director-plugin</artifactId>
           <version>${tycho-version}</version>
           <executions>
             <execution>
               <id>create-distributions</id>
               <goals>
                 <goal>materialize-products</goal>
                 <goal>archive-products</goal>
               </goals>
             </execution>
           </executions>
           <configuration>
             <products>
               <product>
                 <!-- select product with ID product.id; the archives get the classifiers "<os>.<ws>.<arch>" -->
                 <id>product.id</id>
               </product>
               <product>
                 <!-- select product with ID other.product.id for the classifiers "other-<os>.<ws>.<arch>" -->
                 <id>other.product.id</id>
                 <attachId>other</attachId>
               </product>
             </products>
           </configuration>
         </plugin>
         
        The following snippet shows the optional parameters which can be specified per product:
           <configuration>
             <products>
               <product>
                 <id>product.id</id>
                 <!-- optional parameters -->
                 <rootFolder></rootFolder>
                 <rootFolders>
                   <macosx></macosx>
                   <linux></linux>
                   <freebsd></freebsd>
                   <win32></win32>
                 </rootFolders>
               </product>
               ...
             </products>
           </configuration>
         
        Details on the product-specific configuration parameters:
        • rootFolder - The path where the installed product shall be stored in the archive, e.g. "eclipse". By default, the product is stored in the archive root.
        • rootFolders - OS-specific installation root folders, overriding rootFolder. Allowed children are <macosx>, <win32>, <linux> and <freebsd> or any other OS supported by p2. Since 0.18.0
      • forkedProcessTimeoutInSeconds

        @Parameter(property="p2.timeout",
                   defaultValue="0")
        private int forkedProcessTimeoutInSeconds
        Kill the forked process after a certain number of seconds. If set to 0, wait forever for the process, never timing out.
    • Constructor Detail

      • AbstractProductMojo

        AbstractProductMojo()
    • Method Detail

      • getForkedProcessTimeoutInSeconds

        int getForkedProcessTimeoutInSeconds()
      • getProject

        org.apache.maven.project.MavenProject getProject()
      • getSession

        org.apache.maven.execution.MavenSession getSession()
      • getProductsBuildDirectory

        java.io.File getProductsBuildDirectory()
      • getProductMaterializeDirectory

        java.io.File getProductMaterializeDirectory​(Product product,
                                                    TargetEnvironment env)
      • getProductConfig

        ProductConfig getProductConfig()
                                throws org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoFailureException
      • getOsWsArch

        static java.lang.String getOsWsArch​(TargetEnvironment env,
                                            char separator)