<?xml version="1.0" encoding="utf-8"?>
<!--
 ~ Copyright (c) 2010, WSO2 Inc. (http://www.wso2.org) 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.carbon</groupId>
        <artifactId>bam-feature</artifactId>
        <version>3.2.0</version>
	<relativePath>../../pom.xml</relativePath>
    </parent>

    <version>${carbon.platform.patch.version.3.2.2}</version>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>org.wso2.carbon.bam.server.feature</artifactId>
    <packaging>pom</packaging>
    <name>WSO2 Carbon - BAM Core Feature</name>
    <url>http://wso2.org</url>
    <description>This feature contains the core bundles required for BAM back end</description>

    <dependencies>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.bam.core</artifactId>
	    <version>${carbon.platform.patch.version.3.2.2}</version>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.bam.util</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.bam.cep</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.bam.common</artifactId>
	    <version>${carbon.platform.patch.version}</version>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.bam.services.stub</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.operation.mgt.stub</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.service.mgt.stub</artifactId>
            <version>${carbon.platform.patch.version.3.2.2}</version> 
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.statistics.stub</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
	    <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.1</version>
                <executions>
                    <execution>
                        <id>process</id>
                        <phase>process-sources</phase>
                        <configuration>
                            <tasks>
                                  <zip destfile="resources/conf/dashboard.zip" basedir="resources/dashboard"/>
				  <zip destfile="resources/conf/dataservices.zip" basedir="resources/dataservices"/>
				  <zip destfile="resources/conf/sql.zip" basedir="resources/sql"/>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                     </execution>
                 </executions>
            </plugin> 
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>src/main/resources</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>resources</directory>
                                    <includes>
                                        <include>conf/datasources.properties</include>
                                        <include>conf/bam.xml</include>
                                        <include>conf/dashboard.zip</include>
                                        <include>conf/dataservices.zip</include>
                                        <include>conf/sql.zip</include>
                                        <include>p2.inf</include>
                                        <include>build.properties</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.wso2.maven</groupId>
                <artifactId>carbon-p2-plugin</artifactId>
                <version>${carbon.p2.plugin.version}</version>
                <executions>
                    <execution>
                        <id>4-p2-feature-generation</id>
                        <phase>package</phase>
                        <goals>
                            <goal>p2-feature-gen</goal>
                        </goals>
                        <configuration>
                            <id>org.wso2.carbon.bam.server</id>
                            <propertiesFile>../../../etc/feature.properties</propertiesFile>
                            <adviceFile>
                                <properties>
                                    <propertyDef>org.wso2.carbon.p2.category.type:server
                                    </propertyDef>
                                    <propertyDef>org.eclipse.equinox.p2.type.group:false
                                    </propertyDef>
                                </properties>
                            </adviceFile>
                            <bundles>
                                <bundleDef>org.wso2.carbon:org.wso2.carbon.bam.core</bundleDef>
                                <bundleDef>org.wso2.carbon:org.wso2.carbon.bam.common</bundleDef>
                                <bundleDef>org.wso2.carbon:org.wso2.carbon.bam.util</bundleDef>
                                <bundleDef>org.wso2.carbon:org.wso2.carbon.bam.cep</bundleDef>
                                <bundleDef>org.wso2.carbon:org.wso2.carbon.bam.services.stub
                                </bundleDef>
                                <bundleDef>org.wso2.carbon:org.wso2.carbon.operation.mgt.stub
                                </bundleDef>
                                <bundleDef>org.wso2.carbon:org.wso2.carbon.service.mgt.stub
                                </bundleDef>
                                <bundleDef>org.wso2.carbon:org.wso2.carbon.statistics.stub
                                </bundleDef>
                            </bundles>
                            <importFeatures>
                                <importFeatureDef>org.wso2.carbon.core.server:${wso2carbon.version}</importFeatureDef>
				<importFeatureDef>org.wso2.carbon.event.server:${wso2carbon.version}</importFeatureDef>
				<importFeatureDef>org.wso2.carbon.dataservices.server:${carbon.platform.patch.version.3.2.2}</importFeatureDef>
                                <importFeatureDef>org.wso2.carbon.datasource.server:${carbon.platform.patch.version.3.2.2}</importFeatureDef>
                                <importFeatureDef>org.wso2.carbon.dashboard.server:${carbon.platform.patch.version.3.2.2}</importFeatureDef>
                                <importFeatureDef>org.wso2.carbon.dashboard.dashboardpopulator.server:${carbon.platform.patch.version.3.2.2}</importFeatureDef>                       
                            </importFeatures>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
	    <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.1</version>
                <executions>
                    <execution>
                        <id>clean resources</id>
                        <phase>install</phase>
                        <configuration>
                            <tasks>
                                <delete dir="src"/>
                                <delete file="resources/conf/dashboard.zip"/>
                                <delete file="resources/conf/dataservices.zip"/>
                                <delete file="resources/conf/sql.zip"/>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <properties>
        <carbon.platform.patch.version>3.2.1</carbon.platform.patch.version>
	<carbon.platform.patch.version.3.2.2>3.2.2</carbon.platform.patch.version.3.2.2>
    </properties>

</project>
