<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~
  ~   Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
  ~
  ~   WSO2 Inc. licenses this file to you 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</groupId>
        <artifactId>wso2</artifactId>
        <version>5</version>
        <!-- Empty relative path tag added to suppress warning-->
        <relativePath />
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <groupId>org.wso2.ei</groupId>
    <artifactId>msf4j-profile</artifactId>
    <version>6.2.0</version>
    <packaging>pom</packaging>
    <name>WSO2 MSF4J Runtime</name>

    <properties>
        <carbon.messaging.version>1.0.11</carbon.messaging.version>
        <carbon.transport.http.netty.version>3.0.5</carbon.transport.http.netty.version>
        <carbon.metrics.version>2.0.0</carbon.metrics.version>
        <msf4j.version>2.2.2</msf4j.version>
        <carbon.feature.plugin.version>2.0.1</carbon.feature.plugin.version>
        <carbon.kernel.version>5.1.2</carbon.kernel.version>
        <osgi.api.version>6.0.0</osgi.api.version>
        <carbon.jndi.version>1.0.0</carbon.jndi.version>
        <carbon.cache.version>1.0.0</carbon.cache.version>
        <carbon.deployment.version>5.0.0</carbon.deployment.version>
        <carbon.datasources.version>1.0.0</carbon.datasources.version>
    </properties>

   <dependencies>
        <!-- Carbon -->
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.kernel.feature</artifactId>
            <version>${carbon.kernel.version}</version>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.runtime.feature</artifactId>
            <version>${carbon.kernel.version}</version>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.launcher</artifactId>
            <version>${carbon.kernel.version}</version>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.jndi</groupId>
            <artifactId>org.wso2.carbon.jndi.feature</artifactId>
            <version>${carbon.jndi.version}</version>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.caching</groupId>
            <artifactId>org.wso2.carbon.caching.feature</artifactId>
            <version>${carbon.cache.version}</version>
            <type>zip</type>
        </dependency>

        <dependency>
            <groupId>org.wso2.carbon.datasources</groupId>
            <artifactId>org.wso2.carbon.datasource.core.feature</artifactId>
            <version>${carbon.datasources.version}</version>
            <type>zip</type>
        </dependency>

        <dependency>
            <groupId>org.wso2.carbon.messaging</groupId>
            <artifactId>org.wso2.carbon.messaging.feature</artifactId>
            <version>${carbon.messaging.version}</version>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.transport</groupId>
            <artifactId>org.wso2.carbon.transport.http.netty.feature</artifactId>
            <version>${carbon.transport.http.netty.version}</version>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.metrics</groupId>
            <artifactId>org.wso2.carbon.metrics.core.feature</artifactId>
            <version>${carbon.metrics.version}</version>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.metrics</groupId>
            <artifactId>org.wso2.carbon.metrics.jdbc.core.feature</artifactId>
            <version>${carbon.metrics.version}</version>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.metrics</groupId>
            <artifactId>org.wso2.carbon.metrics.das.core.feature</artifactId>
            <version>${carbon.metrics.version}</version>
            <type>zip</type>
        </dependency>
       <dependency>
           <groupId>org.wso2.carbon.deployment</groupId>
           <artifactId>org.wso2.carbon.deployment.engine.feature</artifactId>
           <version>${carbon.deployment.version}</version>
           <type>zip</type>
       </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>${osgi.api.version}</version>
        </dependency>

        <!-- MSF4J -->
        <dependency>
            <groupId>org.wso2.msf4j</groupId>
            <artifactId>org.wso2.msf4j.feature</artifactId>
            <version>${msf4j.version}</version>
            <type>zip</type>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <inherited>false</inherited>
                <executions>
                    <execution>
                        <id>unpack-equinox-executable</id>
                        <phase>package</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.eclipse.equinox</groupId>
                                    <artifactId>org.eclipse.equinox.executable</artifactId>
                                    <version>3.5.0.v20110530-7P7NFUFFLWUl76mart</version>
                                    <type>zip</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>target</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.wso2.carbon.maven</groupId>
                <artifactId>carbon-feature-plugin</artifactId>
                <version>${carbon.feature.plugin.version}</version>
                <executions>
                    <execution>
                        <id>p2-repo-generation</id>
                        <phase>package</phase>
                        <goals>
                            <goal>generate-repo</goal>
                        </goals>
                        <configuration>
                            <targetRepository>file:${basedir}/target/p2-repo</targetRepository>
                            <features>
                                <feature>
                                    <id>org.wso2.carbon.kernel.feature</id>
                                    <version>${carbon.kernel.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.runtime.feature</id>
                                    <version>${carbon.kernel.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.caching.feature</id>
                                    <version>${carbon.cache.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.msf4j.feature</id>
                                    <version>${msf4j.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.messaging.feature</id>
                                    <version>${carbon.messaging.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.transport.http.netty.feature</id>
                                    <version>${carbon.transport.http.netty.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.jndi.feature</id>
                                    <version>${carbon.jndi.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.metrics.core.feature</id>
                                    <version>${carbon.metrics.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.metrics.jdbc.core.feature</id>
                                    <version>${carbon.metrics.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.metrics.das.core.feature</id>
                                    <version>${carbon.metrics.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.datasource.core.feature</id>
                                    <version>${carbon.datasources.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.deployment.engine.feature</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                            </features>
                        </configuration>
                    </execution>
                    <execution>
                        <id>publishing products</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>
                            <repositoryURL>file:${basedir}/target/p2-repo</repositoryURL>
                        </configuration>
                    </execution>
                    <execution>
                        <id>materialize-product</id>
                        <phase>package</phase>
                        <goals>
                            <goal>generate-profile</goal>
                        </goals>
                        <configuration>
                            <productConfigurationFile>${basedir}/carbon.product
                            </productConfigurationFile>
                            <repositoryURL>file:${basedir}/target/p2-repo</repositoryURL>
                            <targetPath>
                                file:${basedir}/target/wso2msf4j-${msf4j.version}/osgi
                            </targetPath>
                            <profile>profiles/default</profile>
                        </configuration>
                    </execution>
                    <execution>
                        <id>feature-installation</id>
                        <phase>package</phase>
                        <goals>
                            <goal>install</goal>
                        </goals>
                        <configuration>
                            <profile>profiles/default</profile>
                            <repositoryURL>file:${basedir}/target/p2-repo</repositoryURL>
                            <destination>
                                ${basedir}/target/wso2msf4j-${msf4j.version}/osgi
                            </destination>
                            <deleteOldProfileFiles>true</deleteOldProfileFiles>
                            <features>
                                <feature>
                                    <id>org.wso2.carbon.kernel.feature.group</id>
                                    <version>${carbon.kernel.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.caching.feature.group</id>
                                    <version>${carbon.cache.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.msf4j.feature.group</id>
                                    <version>${msf4j.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.messaging.feature.group</id>
                                    <version>${carbon.messaging.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.transport.http.netty.feature.group</id>
                                    <version>${carbon.transport.http.netty.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.jndi.feature.group</id>
                                    <version>${carbon.jndi.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.metrics.core.feature.group</id>
                                    <version>${carbon.metrics.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.metrics.jdbc.core.feature.group</id>
                                    <version>${carbon.metrics.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.metrics.das.core.feature.group</id>
                                    <version>${carbon.metrics.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.datasource.core.feature.group</id>
                                    <version>${carbon.datasources.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.deployment.engine.feature.group</id>
                                    <version>${carbon.deployment.version}</version>
                                </feature>
                            </features>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <configuration>
                            <tasks>
                                <replace dir="target/wso2msf4j-${msf4j.version}/osgi" token="false" value="true">
                                    <include name="**/bundles.info" />
                                </replace>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>clean_target</id>
                        <phase>install</phase>
                        <configuration>
                            <target>
                                <delete dir="target/archive-tmp" />
                                <delete dir="target/dependency-maven-plugin-markers" />
                                <delete dir="target/org.eclipse.equinox.executable-3.5.0.v20110530-7P7NFUFFLWUl76mart" />
                                <delete dir="target/p2-repo" />
                               
                                <delete file="target/tmp" />
                                <delete dir="target/antrun" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>

                </executions>
            </plugin>
        </plugins>
    </build>

    <pluginRepositories>
        <pluginRepository>
            <id>wso2-nexus</id>
            <name>WSO2 Public Repository</name>
            <url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
                <checksumPolicy>ignore</checksumPolicy>
            </releases>
        </pluginRepository>
        <pluginRepository>
            <id>wso2-releases</id>
            <name>WSO2 Releases Repository</name>
            <url>http://maven.wso2.org/nexus/content/repositories/releases/</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
                <checksumPolicy>ignore</checksumPolicy>
            </releases>
        </pluginRepository>
        <pluginRepository>
            <id>wso2-snapshots</id>
            <name>WSO2 Snapshot Repository</name>
            <url>http://maven.wso2.org/nexus/content/repositories/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>

    <repositories>
        <repository>
            <id>wso2-nexus</id>
            <name>WSO2 Public Repository</name>
            <url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
                <checksumPolicy>ignore</checksumPolicy>
            </releases>
        </repository>
        <repository>
            <id>wso2-releases</id>
            <name>WSO2 Releases Repository</name>
            <url>http://maven.wso2.org/nexus/content/repositories/releases/</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
                <checksumPolicy>ignore</checksumPolicy>
            </releases>
        </repository>
        <repository>
            <id>wso2-snapshots</id>
            <name>WSO2 Snapshot Repository</name>
            <url>http://maven.wso2.org/nexus/content/repositories/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>

  <scm>
    <tag>v6.2.0-rc1</tag>
  </scm>
</project>
