<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
    Copyright 2013 Red Hat, Inc. and/or its affiliates.

    This file is part of lightblue.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses />.
-->
<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">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.redhat.lightblue.rest</groupId>
        <artifactId>rest-pom</artifactId>
        <version>1.0.0</version>
    </parent>
    <groupId>com.redhat.lightblue.rest</groupId>
    <artifactId>rest-crud</artifactId>
    <packaging>war</packaging>
    <version>1.0.0</version>
    <name>lightblue-rest: ${project.groupId}|${project.artifactId}</name>
    <dependencies>
        <dependency>
            <groupId>com.redhat.lightblue</groupId>
            <artifactId>core-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.redhat.lightblue.config</groupId>
            <artifactId>core-config</artifactId>
        </dependency>
        <dependency>
            <groupId>com.redhat.lightblue.rest</groupId>
            <artifactId>rest-common</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.redhat.lightblue.mongo</groupId>
            <artifactId>mongo-crud</artifactId>
        </dependency>
        <dependency>
            <groupId>com.redhat.lightblue.mongo</groupId>
            <artifactId>mongo-metadata</artifactId>
        </dependency>
        <dependency>
            <groupId>com.redhat.lightblue.mongo</groupId>
            <artifactId>mongo-config</artifactId>
        </dependency>
        <dependency>
            <groupId>de.flapdoodle.embed</groupId>
            <artifactId>de.flapdoodle.embed.mongo</artifactId>
            <version>1.46.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.4.181</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-catalina</artifactId>
            <version>8.0.9</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <!-- Arquillian website suggestion due some bugs in the surefire default version -->
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12</version>
                <configuration>
                    <argLine>-Darquillian.deploymentExportPath=target/xyz</argLine>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <attachClasses>true</attachClasses>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>rpm</id>
            <build>
                <plugins>
                    <!-- RPM packing -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>rpm-maven-plugin</artifactId>
                        <version>2.1-alpha-3</version>
                        <extensions>true</extensions>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>rpm</goal>
                                </goals>
                                <phase>verify</phase>
                            </execution>
                        </executions>
                        <configuration>
                            <name>lightblue-${project.artifactId}</name>
                            <copyright>Red Hat</copyright>
                            <distribution>RHEL</distribution>
                            <group>Lightblue Platform</group>
                            <packager>${user.name}</packager>
                            <defaultFilemode>744</defaultFilemode>
                            <defaultUsername>jboss</defaultUsername>
                            <defaultGroupname>jboss</defaultGroupname>
                            <mappings>
                                <mapping>
                                    <directory>${rpm.install.basedir}</directory>
                                    <directoryIncluded>false</directoryIncluded>
                                    <sources>
                                        <source>
                                            <location>target/${project.artifactId}-${project.version}.${project.packaging}</location>
                                        </source>
                                    </sources>
                                </mapping>
                            </mappings>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
