<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.dataservice</groupId>
        <artifactId>dataservice-solution-parent</artifactId>
        <version>2.3</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>org.wso2.ws.dataservice</artifactId>
    <packaging>bundle</packaging>
    <name>WSO2 Data Service Core</name>
    <url>http://wso2.org</url>
    <description>WSO2 Data Services Core Bundle</description>

    <repositories>
        <repository>
            <id>wso2-maven2-repository</id>
            <url>http://dist.wso2.org/maven2</url>
        </repository>
    </repositories>

    <dependencies>
        <!--
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.framework</artifactId>
            <version>1.0.3</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>1.0.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.main</artifactId>
            <version>1.0.3</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.osgi.compendium</artifactId>
            <version>1.0.0</version>
            <scope>provided</scope>
        </dependency>
        -->
        <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-kernel</artifactId>
        </dependency>  
        <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-adb</artifactId>
        </dependency>  
        
        <!-- Removing unwanted dependencies for wsas 2.3 release -->        
        <!--
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.core</artifactId>
        </dependency>

        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.registry.service</artifactId>
        </dependency>
        -->
        <dependency>
            <groupId>au.com.bytecode.opencsv</groupId>
            <artifactId>opencsv</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
        </dependency>

        <!-- is this needed? -->
        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derby</artifactId>
            <version>10.3.2.1</version>
        </dependency>

        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-pool</groupId>
            <artifactId>commons-pool</artifactId>
        </dependency>
        
        <!-- JDBC Driver classes -->
        <!-- uncomment before running tests -->
        <!--
        <dependency>
            <groupId>com.mysql.jdbc</groupId>
            <artifactId>Driver</artifactId>
            <version>2.0</version>
            <scope>system</scope>
            <systemPath>${basedir}/src/test/resources/lib/mysql-connector-java-5.1.5-bin.jar</systemPath>
        </dependency>  
        -->        

    </dependencies>


    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <inherited>true</inherited>
                <configuration>
                    <forkMode>pertest</forkMode>
                    <argLine>-enableassertions</argLine>
                    <testFailureIgnore>false</testFailureIgnore>
                    <skip>true</skip>
                    <excludes>
                        <include>**/*.java</include>
                    </excludes>
                </configuration>
            </plugin>            
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>1.4.0</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
                        <Bundle-Name>${pom.artifactId}</Bundle-Name>
                        <Bundle-Version>1.0.0</Bundle-Version>
                        <Export-Package>
                            org.wso2.ws.dataservice; version=1.0.0,
                            org.wso2.ws.dataservice.admin; version=1.0.0,
                            org.wso2.ws.dataservice.beans; version=1.0.0,
                            org.wso2.ws.dataservice.sanple; version=1.0.0,
                        </Export-Package>
                        <Import-Package>
                            !org.wso2.ws.dataservice,
                            !org.wso2.ws.dataservice.admin,
                            !org.wso2.ws.dataservice.beans,
                            !org.wso2.ws.dataservice.sanple,
                            org.wso2.carbon.registry.service; version=1.0.0,
                            *;resolution:=optional
                        </Import-Package>
                        <Require-Bundle>
                            org.wso2.carbon.axis2;visibility:=reexport
                        </Require-Bundle>
                        <DynamicImport-Package>*</DynamicImport-Package>
                        <Embed-Dependency>commons-dbcp|commons-pool|derby|opencsv|poi;scope=compile|runtime;inline=false;</Embed-Dependency>
                        <!--
                        No need to have an Activator for data service core,presence in classpath is sufficient.                        
                        <Bundle-Activator>org.wso2.ws.dataservice.Activator</Bundle-Activator>
                        -->
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>generate-test-repository</id>
                            <phase>generate-test-sources</phase>
                            <configuration>
                                <tasks>
                                    <echo>######################################</echo>
                                    <echo>creating repository for data services</echo>
                                    <echo>######################################</echo>
                                    <mkdir dir="${basedir}/target/repository"/>
                                    <mkdir dir="${basedir}/target/repository/dataservices"/>
                                    <mkdir dir="${basedir}/target/repository/services"/>
                                    <mkdir dir="${basedir}/target/repository/modules"/>
                                    <property name="sample_dbs_files_dir" value="${basedir}/src/test/resources/test-dbs"/>
                                    <copy todir="${basedir}/target/repository/dataservices">
                                      <fileset dir="${sample_dbs_files_dir}">
                                       <include name="**/*.dbs"/>
                                      </fileset>
                                    </copy>                                    
                                </tasks>
                            </configuration>
                            <goals>
                                <goal>run</goal>
                            </goals>
                        </execution>
                    </executions>
              </plugin>
        </plugins>
    </build>
</project>
