<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF 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/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache.syncope</groupId>
    <artifactId>syncope</artifactId>
    <version>1.2.9</version>
  </parent>

  <name>Apache Syncope Build Tools</name>
  <description>Apache Syncope Build Tools</description>
  <groupId>org.apache.syncope</groupId>
  <artifactId>syncope-build-tools</artifactId>
  <packaging>war</packaging>

  <distributionManagement>
    <site>
      <id>syncope.website</id>
      <name>Apache Syncope website</name>
      <url>${site.deploymentBaseUrl}/${project.artifactId}</url>
    </site>
  </distributionManagement>

  <dependencies>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.directory.server</groupId>
      <artifactId>apacheds-all</artifactId>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
    </dependency>

    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>net.tirasa.connid</groupId>
      <artifactId>connector-framework</artifactId>
    </dependency>
    <dependency>
      <groupId>net.tirasa.connid</groupId>
      <artifactId>connector-framework-internal</artifactId>
    </dependency>

    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
    </dependency>

    <dependency>
      <groupId>net.tirasa.connid.bundles.db</groupId>
      <artifactId>net.tirasa.connid.bundles.db.table</artifactId>
      <version>${connid.db.table.version}</version>
      <scope>runtime</scope>
    </dependency>     

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.5.6</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.5.6</version>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
      <version>1.5.6</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <webResources>
            <resource>
              <directory>src/main/webapp</directory>
              <includes>
                <include>WEB-INF/web.xml</include>
              </includes>
              <filtering>true</filtering>
            </resource>
            <resource>
              <directory>${project.build.outputDirectory}</directory>
              <includes>
                <include>META-INF/DEPENDENCIES*</include>
              </includes>
            </resource>
            <resource>
              <directory>${basedir}</directory>
              <targetPath>META-INF</targetPath>
              <includes>
                <include>LICENSE</include>
                <include>NOTICE</include>
              </includes>
            </resource>
          </webResources>
          <packagingExcludes>WEB-INF/classes/META-INF/LICENSE*,WEB-INF/classes/META-INF/NOTICE*,WEB-INF/classes/META-INF/DEPENDENCIES*</packagingExcludes>
          <archive>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <container>
            <dependencies>
              <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
              </dependency>
            </dependencies>
          </container>
          <configuration>
            <properties>
              <cargo.servlet.port>${cargo.servlet.port}</cargo.servlet.port>
            </properties>
          </configuration>
          <deployables>
            <deployable>
              <location>${project.build.directory}/syncope-build-tools-${project.version}.war</location>
              <properties>
                <context>syncope-build-tools</context>
              </properties>
            </deployable>
          </deployables>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
            <configuration>
              <instructions>
                <Bundle-Name>${project.name}</Bundle-Name>
                <Bundle-SymbolicName>org.apache.syncope.buildtools</Bundle-SymbolicName>
                <Bundle-Version>${project.version}</Bundle-Version>
                <Export-Package>
                  org.apache.syncope.buildtools*;version=${project.version};-split-package:=merge-first
                </Export-Package>
                <Import-Package>
                  javax.naming*,
                  javax.servlet*,
                  javax.sql,
                  org.springframework*;version="[3,4)",
                  org.apache.directory*;version="[0.9,2)";resolution:=optional,
                  org.h2.tools;version="[1.3,2)";resolution:=optional,
                  org.slf4j;resolution:=optional
                </Import-Package>
              </instructions>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>

    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
      <resource>
        <directory>..</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>LICENSE</include>
          <include>NOTICE</include>
        </includes>
      </resource>
    </resources>
  </build>

</project>
