Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Install Maven3 and Ant.
  2. Create a directory and copy the pom.xml file given below.

    Info

    This example provides a sample pom.xml file to create a new feature installed distribution, which uses the default profile (<profile>default</profile>) and the corresponding directory path (dir="<PRODUCT_NAME>/repository/components/default/configuration/org.eclipse.equinox.simpleconfigurator">).

    You need to update the following values:

    • The name of your product should replace <PRODUCT_HOME>(e.g., EI-6.0.0).The relevant profile (e.g., default, worker) should replace $profile. For more information about server profiles, see Creating New Server Profiles in WSO2 Carbon documentation.
    • Value of the <destination> element should be wso2ei-6.0.0/wso2/components.
    • Value of the dir attribute in the <replace> element should be wso2ei-6.0.0/wso2/components/default/configuration/org.eclipse.equinox.simpleconfigurator.Change the values in the <feature> section according to the feature you want to install.

    For more information on the plugins, see maven-antrun-plugin and Carbon P2 plugin.


    Code Block
    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-v4_4.0_.0.xsd">
    
       <modelVersion>4.0.0</modelVersion>
        <groupId>org.wso2.sample</groupId>
     
      <artifactId>sample-feature-installation</artifactId>
     
      <version>1.0.0</version>
        <packaging>pom</packaging>
     
      <name>New feature</name>
     
      <url>http://wso2.org</url>
    
       <build>
            <plugins>
         
          <plugin>
      
                 <groupId>org.wso2.maven</groupId>
     
                  <artifactId>carbon-p2-plugin</artifactId>
     
                  <version>1.5.4</version>
         
              <executions>
                        <execution>
            
                   <id>feature-install</id>
       
                        <phase>package</phase>
               
                <goals>
                 
                  <goal>p2-profile-gen</goal>
          
                     </goals>
             
                  <configuration>
                                <profile>default</profile>
                                <metadataRepository>file:p2-repo<<metadataRepository>http://product-dist.wso2.com/p2/carbon/releases/wilkes/</metadataRepository>
                                <artifactRepository>file:p2-repo<<artifactRepository>http://product-dist.wso2.com/p2/carbon/releases/wilkes/</artifactRepository>
                                <destination>$distribution_name/repository<destination>wso2ei-6.0.0/wso2/components</destination>
                                <deleteOldProfileFiles>false</deleteOldProfileFiles>
            
                       <features>
                  
                     <feature>
         
                                  <id>org.wso2.carbon.tryithl7.feature.group</id>
    
                                       <version>4.36.0<6</version>
        
                               </feature>
      
                             </features>
            
                   </configuration>
             
              </execution>
           
            </executions>
                </plugin>
         
          <plugin>
     
                  <groupId>org.apache.maven.plugins</groupId>
    
                   <artifactId>maven-antrun-plugin</artifactId>
    
                   <version>1.1</version>
        
               <executions>
             
              <execution>
    
                           <phase>package</phase>
      
                         <configuration>
                                <tasks>
       
                                <replace token="false" value="true" dir="$distribution_name/repositorywso2ei-6.0.0/wso2/components/default/configuration/org.eclipse.equinox.simpleconfigurator">
      
                                     <include name="**/bundles.info"/>
                                    </replace>
             
                      </tasks>
                            </configuration>
                            <goals>
    
                               <goal>run</goal>
                            </goals>
          
                 </execution>
       
                </executions>
                </plugin>
            </plugins>
    
       </build>
     
      <repositories>
     
          <repository>
        
           <id>wso2-nexus</id>
         
          <name>WSO2 internal Repository</name>
         
          <url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
    
               <releases>
           
            <enabled>true</enabled>
    
                   <updatePolicy>daily</updatePolicy>
                    <checksumPolicy>ignore</checksumPolicy>
                </releases>
       
        </repository>
     
      </repositories>
        <pluginRepositories>
            <pluginRepository>
    
               <id>wso2-maven-releases-repository</id>
         
          <url>http://maven.wso2.org/nexus/content/repositories/releases/</url>
     
          </pluginRepository>
       
        <pluginRepository>
    
               <id>wso2-maven-snapshots-repository</id>
     
              <url>http://maven.wso2.org/nexus/content/repositories/snapshots/</url>
            </pluginRepository>
     
      </pluginRepositories>
    </project>
  3. Unzip the original product distribution (e.g., wso2carbon-<version>.zip) and the relevant p2 repository (e.g., http://product-dist.wso2.com/p2/carbon/releases/wilkes/) to the same directory location. 
  4. Replace the $distribution_name params found in pom.xml file, with the unzipped product distribution name (e.g., wso2carbon-<version>
  5. In the pom.xml file list down the features you want to install into the system. 
    Example:

    Code Block
     <feature> 
       <id>org.wso2.carbon.tryit.feature.group</id> 
       <version>4.3.0</version> 
    </feature>
  6. Execute the following command:

    Code Block
    mvn clean install

    Upon successful invocation of the build, the product distribution is provisioned with the new features. This approach is scriptable.