<?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.carbon</groupId>
        <artifactId>carbon-kernel</artifactId>
        <version>4.10.22</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>org.wso2.carbon.user.core</artifactId>
    <packaging>bundle</packaging>
    <name>WSO2 Carbon - User Manager Kernel</name>
    <description>A custom wso2 product</description>
    <url>http://wso2.org</url>

    <dependencies>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>javax.cache.wso2</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-lang.wso2</groupId>
            <artifactId>commons-lang</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.user.api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.orbit.xerces</groupId>
            <artifactId>xercesImpl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.utils</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.wso2.orbit.com.h2database</groupId>
            <artifactId>h2-engine</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.wso2.org.ops4j.pax.logging</groupId>
            <artifactId>pax-logging-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
            <artifactId>jdbc-pool</artifactId>
            <version>${jdbc-pool.version}</version>
        </dependency>
        <dependency>
            <groupId>org.wso2.orbit.org.apache.tomcat</groupId>
            <artifactId>tomcat</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.securevault</groupId>
            <artifactId>org.wso2.securevault</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>commons-pool.wso2</groupId>
            <artifactId>commons-pool</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>backport-util-concurrent.wso2</groupId>
            <artifactId>backport-util-concurrent</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.wso2.orbit.commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.component.annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.annotation</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.metatype.annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.compendium</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-jul</artifactId>
            <scope>test</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <scope>test</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <scope>test</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.crypto</groupId>
            <artifactId>org.wso2.carbon.crypto.api</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <!-- here the phase you need -->
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/clear-resources</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/test/resources</directory>
                                    <includes>
                                        <include>**/user-mgt-clear.xml</include>
                                        <include>**/WSO2CARBON_DB_CLEAR.mv.db</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>

                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Activator>org.wso2.carbon.user.core.internal.Activator
                        </Bundle-Activator>
                        <Private-Package>org.wso2.carbon.user.core.internal, org.wso2.carbon.user.core.jdbc.caseinsensitive,
                            org.wso2.carbon.user.core.constants, org.wso2.carbon.user.core.claim.inmemory</Private-Package>
                        <Export-Package>
                            !org.wso2.carbon.user.core.internal,
                            !org.wso2.carbon.user.core.jdbc.caseinsensitive,
                            org.wso2.carbon.user.core.*
                        </Export-Package>
                        <Import-Package>
                            !javax.xml.namespace,
                            org.wso2.carbon.utils.*,
                            org.apache.axiom.*; version="${imp.pkg.version.axiom}",
                            javax.sql.*,
                            org.apache.commons.logging.*; version="${import.package.version.commons.logging}",
                            org.apache.commons.lang.*;
                            javax.naming.*,
                            javax.xml.stream.*; version="1.0.1",
                            javax.xml.namespace; version=0.0.0,
                            *;resolution:=optional
                        </Import-Package>
                        <DynamicImport-Package>*</DynamicImport-Package>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <inherited>true</inherited>
                <configuration>
                    <excludes>
                        <exclude>**/BaseTestCase.java</exclude>
                    </excludes>
                    <!-- Uncomment this if you need logging -->
                    <!-- systemProperties>
                     <property>
                       <name>log4j.configuration</name>
                       <value>test-log4j.xml</value>
                     </property>
                   </systemProperties -->
                    <classpathDependencyExcludes>
                        <classpathDependencyExclude>org.wso2.org.ops4j.pax.logging:pax-logging-api</classpathDependencyExclude>
                        <classpathDependencyExclude>org.wso2.org.ops4j.pax.logging:pax-logging-log4j2</classpathDependencyExclude>
                    </classpathDependencyExcludes>
                    <systemPropertyVariables>
                        <java.util.logging.manager>org.apache.logging.log4j.jul.LogManager</java.util.logging.manager>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>findbugs</id>
            <activation>
                <property>
                    <name>findbugs</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>findbugs-maven-plugin</artifactId>
                        <version>2.0.1</version>
                        <configuration>
                            <effort>Max</effort>
                            <threshold>Low</threshold>
                            <xmlOutput>false</xmlOutput>
                            <excludeFilterFile>user-core-findbugs-excluded.xml</excludeFilterFile>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
