<!--

    Copyright (C) 2011 Red Hat, Inc. (jdcasey@commonjava.org)

    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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.commonjava.indy</groupId>
    <artifactId>indy-parent</artifactId>
    <version>1.0.0</version>
  </parent>
  
  <groupId>org.commonjava.indy.embed</groupId>
  <artifactId>indy-embedders</artifactId>
  <packaging>pom</packaging>

  <name>Indy :: Embedders :: Parent</name>

  <properties>
    <skipMainFTests>${skipITs}</skipMainFTests>
    <skipTimingFTests>${skipITs}</skipTimingFTests>
  </properties>
  
  <modules>
    <module>savant</module>
    <module>rest-min</module>
    <module>easyprox</module>
  </modules>
  
  <dependencies>
    <dependency>
      <groupId>org.commonjava.indy</groupId>
      <artifactId>indy-bindings-jaxrs</artifactId>
    </dependency>
    <dependency>
      <groupId>org.commonjava.indy</groupId>
      <artifactId>indy-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.commonjava.indy</groupId>
      <artifactId>indy-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.commonjava.indy</groupId>
      <artifactId>indy-subsys-keycloak</artifactId>
    </dependency>
    <dependency>
      <groupId>org.commonjava.indy</groupId>
      <artifactId>indy-db-flat</artifactId>
    </dependency>
    <dependency>
      <groupId>org.commonjava.indy.boot</groupId>
      <artifactId>indy-booter-jaxrs</artifactId>
    </dependency>
    
    <dependency>
      <groupId>org.keycloak</groupId>
      <artifactId>keycloak-undertow-adapter</artifactId>
    </dependency>
    <dependency>
      <groupId>org.keycloak</groupId>
      <artifactId>keycloak-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.keycloak</groupId>
      <artifactId>keycloak-adapter-core</artifactId>  
    </dependency>
    <dependency>
      <groupId>args4j</groupId>
      <artifactId>args4j</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.weld.se</groupId>
      <artifactId>weld-se</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>javax.cache</groupId>
      <artifactId>cache-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.commonjava.indy</groupId>
      <artifactId>indy-ftests-core</artifactId>
    </dependency>
  </dependencies>
  
  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-shade-plugin</artifactId>
          <executions>
            <execution>
              <id>shade-cdi-components</id>
              <goals>
                <goal>shade</goal>
              </goals>
              <phase>package</phase>
              <configuration>
                <createDependencyReducedPom>true</createDependencyReducedPom>
                <keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
                <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
                <!--
                <relocations>
                  <relocation>
                    <pattern>org.commonjava.indy</pattern>
                    <shadedPattern>org.commonjava.indy.shaded</shadedPattern>
                  </relocation>
                </relocations>
                <transformers>
                  <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                </transformers>
                -->
                <artifactSet>
                  <includes>
                    <include>org.commonjava*:*</include>
                  </includes>
                  <excludes>
                    <exclude>org.commonjava.maven.atlas:*</exclude>
                    <exclude>org.commonjava.rwx*:*</exclude>
                    <exclude>org.commonjava*:*ftest*</exclude>
                  </excludes>
                </artifactSet>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
              <configuration>
                <includeDependencySources>true</includeDependencySources>
                <dependencySourceIncludes>
                  <dependencySourceInclude>org.commonjava*</dependencySourceInclude>
                </dependencySourceIncludes>
                <detectOfflineLinks>false</detectOfflineLinks>
                <additionalparam>-Xdoclint:none</additionalparam>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-failsafe-plugin</artifactId>
          <configuration>
            <dependenciesToScan>
              <dependency>org.commonjava.indy:indy-ftests-core</dependency>
            </dependenciesToScan> 
          </configuration>
          <executions>
            <execution>
              <id>integration-tests</id>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
              <configuration>
                <skip>${skipMainFTests}</skip>
                <excludedGroups>org.commonjava.indy.ftest.core.category.EventDependent, org.commonjava.indy.ftest.core.category.TimingDependent</excludedGroups>
              </configuration>
            </execution>
            <execution>
              <id>timing-ftests</id>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
              <configuration>
                <skip>${skipTimingFTests}</skip>
                <forkCount>1</forkCount>
                <groups>org.commonjava.indy.ftest.core.category.EventDependent, org.commonjava.indy.ftest.core.category.TimingDependent</groups>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
  
  <profiles>
    <profile>
      <id>run-its</id>

      <properties>
        <skipITs>${quickITs}</skipITs>
      </properties>
    </profile>
  </profiles>
</project>
