<?xml version="1.0" encoding="utf-8"?>
<!--
 ~ Copyright (c) WSO2 Inc. (http://wso2.com) All Rights Reserved.
 ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License.
 ~ You may obtain a copy of the License at
 ~
 ~      http://www.apache.org/licenses/LICENSE-2.0
 ~
 ~ Unless required by applicable law or agreed to in writing, software
 ~ distributed under the License is distributed on an "AS IS" BASIS,
 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ~ See the License for the specific language governing permissions and
 ~ limitations under the License.
-->

<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/maven-v4_0_0.xsd">

    <parent>
        <groupId>org.wso2.appserver</groupId>
        <artifactId>wso2appserver-parent</artifactId>
        <version>5.3.0</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>wso2appserver-profile-gen</artifactId>
    <packaging>pom</packaging>
    <name>WSO2 AppServer - AppServer Profile Generation</name>
    <url>http://wso2.org</url>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <inherited>false</inherited>
                <executions>
                    <execution>
                        <id>1-unpack-p2-agent-distribution</id>
                        <phase>test</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.wso2.carbon</groupId>
                                    <artifactId>wso2carbon-core</artifactId>
                                    <version>${carbon.kernel.version}</version>
                                    <type>zip</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>target</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.wso2.maven</groupId>
                <artifactId>carbon-p2-plugin</artifactId>
                <version>${carbon.p2.plugin.version}</version>
                <executions>
                    <execution>
                        <id>2-p2-repo-generation</id>
                        <phase>package</phase>
                        <goals>
                            <goal>p2-repo-gen</goal>
                        </goals>
                        <configuration>
                            <metadataRepository>file:${basedir}/target/p2-repo</metadataRepository>
                            <artifactRepository>file:${basedir}/target/p2-repo</artifactRepository>
                            <publishArtifacts>true</publishArtifacts>
                            <publishArtifactRepository>true</publishArtifactRepository>
                            <featureArtifacts>

                                <featureArtifactDef>
                                    org.wso2.carbon:org.wso2.carbon.core.feature:${carbon.kernel.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon:org.wso2.carbon.core.runtime.feature:${carbon.kernel.version}
                                </featureArtifactDef>

                                <!-- Application Hosting Nested category -->
                                <featureArtifactDef>
                                    org.wso2.carbon.deployment:org.wso2.carbon.webapp.mgt.feature:${carbon.deployment.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.commons:org.wso2.carbon.ndatasource.ui.feature:${carbon.commons.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.commons:org.wso2.carbon.ndatasource.feature:${carbon.commons.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.deployment:org.wso2.carbon.as.runtimes.cxf.feature:${carbon.deployment.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.jaggeryjs:org.jaggeryjs.feature:${jaggery.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.jaggeryjs.modules:carbon.feature:${carbon.module.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.jaggeryjs.modules:email.feature:${email.module.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.jaggeryjs.modules:gadget.feature:${gadget.module.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.jaggeryjs.modules:i18n.feature:${i18n.module.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.jaggeryjs.modules:uuid.feature:${uuid.module.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.jaggeryjs.modules:oauth.feature:${oauth.module.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.jaggeryjs.modules:process.feature:${process.module.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.jaggeryjs.modules:ws.feature:${ws.module.version}
                                </featureArtifactDef>

                                <!-- Service Hosting Nested category -->
                                <featureArtifactDef>
                                    org.wso2.carbon.deployment:org.wso2.carbon.service.mgt.feature:${carbon.deployment.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.identity:org.wso2.carbon.security.mgt.server.feature:${carbon.identity.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.deployment:org.wso2.carbon.module.mgt.feature:${carbon.deployment.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.deployment:org.wso2.carbon.aarservices.feature:${carbon.deployment.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.deployment:org.wso2.carbon.jarservices.feature:${carbon.deployment.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.deployment:org.wso2.carbon.springservices.feature:${carbon.deployment.version}
                                </featureArtifactDef>

                                <!-- Composite Application Mgt Nested Category -->
                                <featureArtifactDef>
                                    org.wso2.carbon.commons:org.wso2.carbon.application.mgt.feature:${carbon.commons.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.deployment:org.wso2.carbon.application.mgt.webapp.feature:${carbon.deployment.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.deployment:org.wso2.carbon.application.deployer.webapp.feature:${carbon.deployment.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.identity:org.wso2.carbon.identity.application.mgt.feature:${carbon.identity.version}
                                </featureArtifactDef>

                                <!-- Javaee Runtime Nested Category -->
                                <featureArtifactDef>
                                    org.wso2.carbon.deployment:org.wso2.carbon.javaee.tomee.server.feature:${carbon.deployment.version}
                                </featureArtifactDef>

                                <!-- Miscellaneous -->
                                <featureArtifactDef>
                                    org.wso2.carbon.identity:org.wso2.carbon.security.mgt.feature:${carbon.identity.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.deployment:org.wso2.carbon.repomanager.axis2.feature:${carbon.deployment.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.commons:org.wso2.carbon.event.server.feature:${carbon.commons.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.commons:org.wso2.carbon.discovery.core.feature:${carbon.commons.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.commons:org.wso2.carbon.discovery.admin.ui.feature:${carbon.commons.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.commons:org.wso2.carbon.deployment.synchronizer.feature:${carbon.commons.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.commons:org.wso2.carbon.deployment.synchronizer.git.feature:${carbon.commons.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.commons:org.wso2.carbon.transaction.manager.feature:${carbon.commons.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.ciphertool:org.wso2.ciphertool.feature:${cipher.tool.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.appserver:org.wso2.appserver.utils.feature:${project.version}
                                </featureArtifactDef>

                                <!-- Monitoring Nested Category -->
                                <featureArtifactDef>
                                    org.wso2.carbon.commons:org.wso2.carbon.logging.mgt.feature:${carbon.commons.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.commons:org.wso2.carbon.system.statistics.feature:${carbon.commons.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.commons:org.wso2.carbon.soaptracer.feature:${carbon.commons.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.commons:org.wso2.carbon.databridge.datapublisher.feature:${carbon.commons.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.commons:org.wso2.carbon.message.flows.feature:${carbon.commons.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.deployment:org.wso2.carbon.bam.webapp.agent.feature:${carbon.deployment.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.deployment:org.wso2.carbon.bam.service.agent.feature:${carbon.deployment.version}
                                </featureArtifactDef>

                                <!-- Multi-Tenancy Nested Category -->
                                <featureArtifactDef>
                                    org.wso2.carbon.multitenancy:org.wso2.carbon.tenant.common.feature:${carbon.multitenancy.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.commons:org.wso2.carbon.tenant.mgt.common.feature:${carbon.commons.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.multitenancy:org.wso2.carbon.tenant.usage.agent.feature:${carbon.multitenancy.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.multitenancy:org.wso2.carbon.tenant.throttling.agent.feature:${carbon.multitenancy.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.multitenancy:org.wso2.carbon.tenant.deployment.feature:${carbon.multitenancy.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.appserver:org.wso2.stratos.appserver.dashboard.ui.feature:${project.version}
                                </featureArtifactDef>

                                <!-- Registry Repository Nested Category -->
                                <featureArtifactDef>
                                    org.wso2.carbon.registry:org.wso2.carbon.registry.core.feature:${carbon.registry.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.registry:org.wso2.carbon.registry.ui.menu.feature:${carbon.registry.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.registry:org.wso2.carbon.registry.resource.properties.feature:${carbon.registry.version}
                                </featureArtifactDef>
                                <!--Todo -  Added to resolve issue on server shutdown need to remove once this was properly fixed on Jaggery
                                [Dev] [Registry] NoClassDefFoundError when shutdown the AS -->
                                <featureArtifactDef>
                                    org.wso2.carbon.registry:org.wso2.carbon.registry.contentsearch.feature:${carbon.registry.version}
                                </featureArtifactDef>

                                <!-- Single Sign On (SAML) Nested Category -->
                                <featureArtifactDef>
                                    org.wso2.carbon.identity:org.wso2.carbon.identity.authenticator.saml2.sso.feature:${carbon.identity.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.identity:org.wso2.carbon.claim.mgt.feature:${carbon.identity.version}
                                </featureArtifactDef>

                                <!-- Styling Nested Category -->
                                <featureArtifactDef>
                                    org.wso2.appserver:org.wso2.appserver.styles.feature:${project.version}
                                </featureArtifactDef>

                                <!-- Tooling Nested Category -->
                                <featureArtifactDef>
                                    org.wso2.carbon.commons:org.wso2.carbon.wsdl.tools.feature:${carbon.commons.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.commons:org.wso2.carbon.tryit.feature:${carbon.commons.version}
                                </featureArtifactDef>

                                <!-- Identity Nested Category -->
                                <featureArtifactDef>
                                    org.wso2.carbon.identity:org.wso2.carbon.user.mgt.feature:${carbon.identity.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.identity:org.wso2.carbon.identity.xacml.ui.feature:${carbon.identity.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.deployment:org.wso2.carbon.identity.xacml.filter.feature:${carbon.deployment.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.identity:org.wso2.carbon.identity.user.profile.feature:${carbon.identity.version}
                                </featureArtifactDef>
                                <featureArtifactDef>
                                    org.wso2.carbon.identity:org.wso2.carbon.identity.core.feature:${carbon.identity.version}
                                </featureArtifactDef>

                            </featureArtifacts>
                        </configuration>
                    </execution>
                    <execution>
                        <id>publishing product</id>
                        <phase>package</phase>
                        <goals>
                            <goal>publish-product</goal>
                        </goals>
                        <configuration>
                            <productConfigurationFile>${basedir}/carbon.product
                            </productConfigurationFile>
                            <executable>
                                ${basedir}/target/org.eclipse.equinox.executable_3.5.0.v20110530-7P7NFUFFLWUl76mart
                            </executable>
                            <metadataRepository>file:${basedir}/target/p2-repo</metadataRepository>
                            <artifactRepository>file:${basedir}/target/p2-repo</artifactRepository>
                        </configuration>
                    </execution>
                    <execution>
                        <id>creating-worker-profile</id>
                        <phase>package</phase>
                        <goals>
                            <goal>materialize-product</goal>
                        </goals>
                        <configuration>
                            <productConfigurationFile>${basedir}/carbon.product</productConfigurationFile>
                            <metadataRepository>file:${basedir}/target/p2-repo</metadataRepository>
                            <artifactRepository>file:${basedir}/target/p2-repo</artifactRepository>
                            <targetPath>
                                file:${basedir}/target/wso2carbon-core-${carbon.kernel.version}/repository/components
                            </targetPath>
                            <profile>worker</profile>
                        </configuration>
                    </execution>
                    <execution>
                        <id>creating-webapp-profile</id>
                        <phase>package</phase>
                        <goals>
                            <goal>materialize-product</goal>
                        </goals>
                        <configuration>
                            <productConfigurationFile>${basedir}/carbon.product</productConfigurationFile>
                            <metadataRepository>file:${basedir}/target/p2-repo</metadataRepository>
                            <artifactRepository>file:${basedir}/target/p2-repo</artifactRepository>
                            <targetPath>
                                file:${basedir}/target/wso2carbon-core-${carbon.kernel.version}/repository/components
                            </targetPath>
                            <profile>webapp</profile>
                        </configuration>
                    </execution>
                    <execution>
                        <id>creating-axis2service-profile</id>
                        <phase>package</phase>
                        <goals>
                            <goal>materialize-product</goal>
                        </goals>
                        <configuration>
                            <productConfigurationFile>${basedir}/carbon.product</productConfigurationFile>
                            <metadataRepository>file:${basedir}/target/p2-repo</metadataRepository>
                            <artifactRepository>file:${basedir}/target/p2-repo</artifactRepository>
                            <targetPath>
                                file:${basedir}/target/wso2carbon-core-${carbon.kernel.version}/repository/components
                            </targetPath>
                            <profile>axis2service</profile>
                        </configuration>
                    </execution>
                    <execution>
                        <id>creating-jaggery-profile</id>
                        <phase>package</phase>
                        <goals>
                            <goal>materialize-product</goal>
                        </goals>
                        <configuration>
                            <productConfigurationFile>${basedir}/carbon.product</productConfigurationFile>
                            <metadataRepository>file:${basedir}/target/p2-repo</metadataRepository>
                            <artifactRepository>file:${basedir}/target/p2-repo</artifactRepository>
                            <targetPath>
                                file:${basedir}/target/wso2carbon-core-${carbon.kernel.version}/repository/components
                            </targetPath>
                            <profile>jaggery</profile>
                        </configuration>
                    </execution>

                    <execution>
                        <id>3-p2-profile-generation</id>
                        <phase>package</phase>
                        <goals>
                            <goal>p2-profile-gen</goal>
                        </goals>
                        <configuration>
                            <profile>default</profile>
                            <metadataRepository>file:${basedir}/target/p2-repo</metadataRepository>
                            <artifactRepository>file:${basedir}/target/p2-repo</artifactRepository>
                            <destination>
                                ${basedir}/target/wso2carbon-core-${carbon.kernel.version}/repository/components
                            </destination>
                            <deleteOldProfileFiles>true</deleteOldProfileFiles>
                            <features>
                                <feature>
                                    <id>org.wso2.carbon.javaee.tomee.server.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.logging.mgt.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.databridge.datapublisher.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.wsdl.tools.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.system.statistics.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.soaptracer.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.repomanager.axis2.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.service.mgt.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.module.mgt.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.aarservices.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.jarservices.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.springservices.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.security.mgt.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.webapp.mgt.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.discovery.core.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.discovery.admin.ui.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.tryit.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.message.flows.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.event.server.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.registry.core.feature.group</id>
                                    <version>${carbon.registry.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.registry.ui.menu.feature.group</id>
                                    <version>${carbon.registry.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.registry.resource.properties.feature.group</id>
                                    <version>${carbon.registry.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.appserver.styles.feature.group</id>
                                    <version>${project.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.appserver.utils.feature.group</id>
                                    <version>${project.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.application.mgt.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.application.mgt.webapp.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.application.deployer.webapp.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.ndatasource.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.ndatasource.ui.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.deployment.synchronizer.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.deployment.synchronizer.git.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.transaction.manager.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>

                                <!--Stratos feature-->
                                <feature>
                                    <id>org.wso2.carbon.tenant.common.feature.group</id>
                                    <version>${carbon.multitenancy.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.tenant.usage.agent.feature.group</id>
                                    <version>${carbon.multitenancy.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.tenant.throttling.agent.feature.group</id>
                                    <version>${carbon.multitenancy.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.tenant.deployment.feature.group</id>
                                    <version>${carbon.multitenancy.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.stratos.appserver.dashboard.ui.feature.group</id>
                                    <version>${project.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.bam.service.agent.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.bam.webapp.agent.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.application.deployer.webapp.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.xacml.filter.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.authenticator.saml2.sso.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.user.profile.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.core.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>


                                <!-- jaggery feature groups -->
                                <feature>
                                    <id>org.jaggeryjs.feature.group</id>
                                    <version>${jaggery.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.carbon.feature.group</id>
                                    <version>${carbon.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.email.feature.group</id>
                                    <version>${email.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.gadget.feature.group</id>
                                    <version>${gadget.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.i18n.feature.group</id>
                                    <version>${i18n.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.oauth.feature.group</id>
                                    <version>${oauth.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.process.feature.group</id>
                                    <version>${process.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.uuid.feature.group</id>
                                    <version>${uuid.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.ws.feature.group</id>
                                    <version>${ws.module.version}</version>
                                </feature>

                                <!--End of jaggery feature groups -->

                                <feature>
                                    <id>org.wso2.carbon.user.mgt.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>


                                <!-- as-runtimes-->
                                <feature>
                                    <id>org.wso2.carbon.as.runtimes.cxf.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>

                                <!-- end of as-runtimes-->


                                <!--Todo -  Added to resolve issue on server shutdown need to remove once this was properly fixed on Jaggary
                                [Dev] [Registry] NoClassDefFoundError when shutdown the AS -->
                                <feature>
                                    <id>org.wso2.carbon.registry.contentsearch.feature.group</id>
                                    <version>${carbon.registry.version}</version>
                                </feature>

                                <feature>
                                    <id>org.wso2.ciphertool.feature.group</id>
                                    <version>${cipher.tool.version}</version>
                                </feature>

                            </features>
                        </configuration>
                    </execution>

                    <execution>
                        <id>p2-profile-generation-for-worker-profile</id>
                        <phase>package</phase>
                        <goals>
                            <goal>p2-profile-gen</goal>
                        </goals>
                        <configuration>
                            <profile>worker</profile>
                            <metadataRepository>file:${basedir}/target/p2-repo</metadataRepository>
                            <artifactRepository>file:${basedir}/target/p2-repo</artifactRepository>
                            <destination>
                                ${basedir}/target/wso2carbon-core-${carbon.kernel.version}/repository/components
                            </destination>
                            <deleteOldProfileFiles>true</deleteOldProfileFiles>
                            <features>
                                <feature>
                                    <id>org.wso2.carbon.javaee.tomee.server.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.core.common.feature.group</id>
                                    <version>${carbon.kernel.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.core.server.feature.group</id>
                                    <version>${carbon.kernel.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.core.runtime.feature.group</id>
                                    <version>${carbon.kernel.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.logging.mgt.server.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.databridge.datapublisher.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.wsdl.tools.server.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.system.statistics.server.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.soaptracer.server.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.repomanager.axis2.server.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.service.mgt.server.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.module.mgt.server.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.aarservices.server.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.jarservices.server.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.springservices.server.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.security.mgt.server.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.webapp.mgt.server.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.discovery.core.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.tryit.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.event.server.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.registry.core.server.feature.group</id>
                                    <version>${carbon.registry.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.registry.resource.properties.server.feature.group
                                    </id>
                                    <version>${carbon.registry.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.appserver.utils.feature.group</id>
                                    <version>${project.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.application.mgt.server.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.application.mgt.webapp.server.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.application.deployer.webapp.feature.group
                                    </id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.deployment.synchronizer.server.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.deployment.synchronizer.subversion.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.deployment.synchronizer.git.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.transaction.manager.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>

                                <!-- Stratos feature -->

                                <feature>
                                    <id>org.wso2.carbon.tenant.common.feature.group</id>
                                    <version>${carbon.multitenancy.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.tenant.usage.agent.feature.group</id>
                                    <version>${carbon.multitenancy.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.tenant.throttling.agent.feature.group</id>
                                    <version>${carbon.multitenancy.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.tenant.deployment.feature.group</id>
                                    <version>${carbon.multitenancy.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.stratos.appserver.dashboard.ui.feature.group</id>
                                    <version>${project.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.bam.service.agent.server.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.bam.webapp.agent.server.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.application.deployer.webapp.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.xacml.filter.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.authenticator.saml2.sso.server.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.user.profile.server.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.core.server.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>


                                <!-- jaggery feature groups -->

                                <feature>
                                    <id>org.jaggeryjs.server.feature.group</id>
                                    <version>${jaggery.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.carbon.feature.group</id>
                                    <version>${carbon.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.email.feature.group</id>
                                    <version>${email.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.gadget.feature.group</id>
                                    <version>${gadget.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.i18n.feature.group</id>
                                    <version>${i18n.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.oauth.feature.group</id>
                                    <version>${oauth.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.process.feature.group</id>
                                    <version>${process.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.uuid.feature.group</id>
                                    <version>${uuid.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.ws.feature.group</id>
                                    <version>${ws.module.version}</version>
                                </feature>

                                <!-- End of jaggery feature groups -->

                                <!--<feature>-->
                                <!--<id>org.apache.synapse.wso2.feature.group</id>-->
                                <!--<version>${synapse.version}</version>-->
                                <!--</feature>-->
                                <feature>
                                    <id>org.wso2.carbon.user.mgt.server.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>

                                <!--  as -runtime features -->
                                <feature>
                                    <id>org.wso2.carbon.as.runtimes.cxf.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <!-- end of as -runtime features -->

                                <!--Todo -  Added to resolve issue on server shutdown need to remove once this was properly fixed on Jaggary
                                [Dev] [Registry] NoClassDefFoundError when shutdown the AS -->
                                <feature>
                                    <id>org.wso2.carbon.registry.contentsearch.feature.group</id>
                                    <version>${carbon.registry.version}</version>
                                </feature>

                            </features>
                        </configuration>
                    </execution>

                    <execution>
                        <id>3-p2-profile-generation-for-webapp</id>
                        <phase>package</phase>
                        <goals>
                            <goal>p2-profile-gen</goal>
                        </goals>
                        <configuration>
                            <profile>webapp</profile>
                            <metadataRepository>file:${basedir}/target/p2-repo</metadataRepository>
                            <artifactRepository>file:${basedir}/target/p2-repo</artifactRepository>
                            <destination>
                                ${basedir}/target/wso2carbon-core-${carbon.kernel.version}/repository/components
                            </destination>
                            <deleteOldProfileFiles>true</deleteOldProfileFiles>
                            <features>
                                <feature>
                                    <id>org.wso2.carbon.javaee.tomee.server.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.logging.mgt.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.databridge.datapublisher.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.wsdl.tools.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.system.statistics.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.repomanager.axis2.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.security.mgt.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.webapp.mgt.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.discovery.core.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.discovery.admin.ui.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.tryit.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.event.server.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.registry.core.feature.group</id>
                                    <version>${carbon.registry.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.registry.ui.menu.feature.group</id>
                                    <version>${carbon.registry.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.registry.resource.properties.feature.group
                                    </id>
                                    <version>${carbon.registry.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.appserver.styles.feature.group</id>
                                    <version>${project.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.appserver.utils.feature.group</id>
                                    <version>${project.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.application.mgt.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.application.mgt.webapp.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.application.deployer.webapp.feature.group
                                    </id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.ndatasource.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.ndatasource.ui.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.deployment.synchronizer.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.deployment.synchronizer.git.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.transaction.manager.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.bam.webapp.agent.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.application.deployer.webapp.feature.group
                                    </id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.xacml.filter.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.authenticator.saml2.sso.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.user.profile.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.core.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.user.mgt.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>

                                <!--       as-runtimes -->
                                <feature>
                                    <id>org.wso2.carbon.as.runtimes.cxf.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>

                                <!--      end of as-runtimes -->


                            </features>
                        </configuration>
                    </execution>

                    <execution>
                        <id>3-p2-profile-generation-for-axis2services</id>
                        <phase>package</phase>
                        <goals>
                            <goal>p2-profile-gen</goal>
                        </goals>
                        <configuration>
                            <profile>axis2service</profile>
                            <metadataRepository>file:${basedir}/target/p2-repo</metadataRepository>
                            <artifactRepository>file:${basedir}/target/p2-repo</artifactRepository>
                            <destination>
                                ${basedir}/target/wso2carbon-core-${carbon.kernel.version}/repository/components
                            </destination>
                            <deleteOldProfileFiles>true</deleteOldProfileFiles>
                            <features>

                                <feature>
                                    <id>org.wso2.carbon.javaee.tomee.server.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.logging.mgt.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.databridge.datapublisher.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.wsdl.tools.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.system.statistics.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.soaptracer.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.repomanager.axis2.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.service.mgt.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.module.mgt.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.aarservices.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.jarservices.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.springservices.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.security.mgt.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.webapp.mgt.server.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.discovery.core.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.discovery.admin.ui.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.tryit.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.message.flows.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.event.server.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.registry.core.feature.group</id>
                                    <version>${carbon.registry.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.registry.ui.menu.feature.group</id>
                                    <version>${carbon.registry.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.registry.resource.properties.feature.group
                                    </id>
                                    <version>${carbon.registry.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.appserver.styles.feature.group</id>
                                    <version>${project.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.appserver.utils.feature.group</id>
                                    <version>${project.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.application.mgt.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.ndatasource.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.ndatasource.ui.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.deployment.synchronizer.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.deployment.synchronizer.git.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.transaction.manager.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.bam.service.agent.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.bam.webapp.agent.server.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.xacml.filter.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.authenticator.saml2.sso.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.user.profile.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.core.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.user.mgt.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>
                            </features>
                        </configuration>
                    </execution>

                    <execution>
                        <id>3-p2-profile-generation-for-jaggery</id>
                        <phase>package</phase>
                        <goals>
                            <goal>p2-profile-gen</goal>
                        </goals>
                        <configuration>
                            <profile>jaggery</profile>
                            <metadataRepository>file:${basedir}/target/p2-repo</metadataRepository>
                            <artifactRepository>file:${basedir}/target/p2-repo</artifactRepository>
                            <destination>
                                ${basedir}/target/wso2carbon-core-${carbon.kernel.version}/repository/components
                            </destination>
                            <deleteOldProfileFiles>true</deleteOldProfileFiles>
                            <features>
                                <feature>
                                    <id>org.wso2.carbon.javaee.tomee.server.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.logging.mgt.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.databridge.datapublisher.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.system.statistics.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.repomanager.axis2.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.discovery.core.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.discovery.admin.ui.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.event.server.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.registry.core.feature.group</id>
                                    <version>${carbon.registry.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.registry.ui.menu.feature.group</id>
                                    <version>${carbon.registry.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.registry.resource.properties.feature.group
                                    </id>
                                    <version>${carbon.registry.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.appserver.styles.feature.group</id>
                                    <version>${project.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.appserver.utils.feature.group</id>
                                    <version>${project.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.application.mgt.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.application.mgt.webapp.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.ndatasource.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.ndatasource.ui.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.deployment.synchronizer.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.deployment.synchronizer.git.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.transaction.manager.feature.group</id>
                                    <version>${carbon.commons.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.bam.webapp.agent.server.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.application.deployer.webapp.feature.group
                                    </id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.xacml.filter.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.authenticator.saml2.sso.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.user.profile.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.identity.core.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>

                                <!-- jaggery feature groups -->

                                <feature>
                                    <id>org.jaggeryjs.feature.group</id>
                                    <version>${jaggery.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.carbon.feature.group</id>
                                    <version>${carbon.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.email.feature.group</id>
                                    <version>${email.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.gadget.feature.group</id>
                                    <version>${gadget.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.i18n.feature.group</id>
                                    <version>${i18n.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.oauth.feature.group</id>
                                    <version>${oauth.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.process.feature.group</id>
                                    <version>${process.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.uuid.feature.group</id>
                                    <version>${uuid.module.version}</version>
                                </feature>
                                <feature>
                                    <id>org.jaggeryjs.modules.ws.feature.group</id>
                                    <version>${ws.module.version}</version>
                                </feature>

                                <!-- End of jaggery feature groups -->

                                <feature>
                                    <id>org.wso2.carbon.user.mgt.feature.group</id>
                                    <version>${carbon.identity.version}</version>
                                </feature>

                                <!--Todo -  Added to resolve issue on server shutdown need to remove once this was properly fixed on Jaggary
                                [Dev] [Registry] NoClassDefFoundError when shutdown the AS -->
                                <feature>
                                    <id>org.wso2.carbon.registry.contentsearch.feature.group</id>
                                    <version>${carbon.registry.version}</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="target/wso2carbon-core-${carbon.kernel.version}/repository/components">
                                    <include name="**/bundles.info" />
                                </replace>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <properties>
    </properties>

</project>
