<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~
  ~  Copyright 2010-2014 Crossing-Tech SA, EPFL QI-J, CH-1015 Lausanne, Switzerland.
  ~  All rights reserved.
  ~
  ~ ==================================================================================
  -->

<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>

    <groupId>io.xtech.babel</groupId>
    <artifactId>babel-parent</artifactId>
    <version>0.6.0</version>

    <packaging>pom</packaging>

    <name>Babel :: Parent</name>

    <properties>

        <scala.binary.version>2.10</scala.binary.version>
        <scala.version>${scala.binary.version}.4</scala.version>

        <camel.version>2.12.4</camel.version>

        <spring.version>3.2.8.RELEASE</spring.version>

        <!-- Logging -->
        <log4j.version>1.2.16</log4j.version>
        <slf4j.version>1.7.3</slf4j.version>

        <!-- Test dependencies -->
        <specs2.version>2.3.10</specs2.version>
        <specs2.plugin.version>0.4.1</specs2.plugin.version>
        <junit.version>4.11</junit.version>

        <cglib.version>2.2</cglib.version>
        <h2.version>1.3.174</h2.version>
        <commons-csv.version>1.0-r706900_3</commons-csv.version>

        <coverage.data.dir>${project.build.outputDirectory}</coverage.data.dir>

    </properties>

    <scm>
        <developerConnection>scm:git:ssh://git@github.com:Crossing-Tech/babel.git</developerConnection>
        <url>https://github.com/Crossing-Tech/babel.git</url>
        <tag>HEAD</tag>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-snapshots</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <inceptionYear>2014</inceptionYear>

    <description>Babel is a Domain Specific Language for Integration</description>
    <url>http://www.crossing-tech.com</url>
    <licenses>
        <license>
            <name>Apache 2</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>leifh</id>
            <name>Leif Hallgren</name>
            <url>https://twitter.com/lhallgren</url>
        </developer>
        <developer>
            <id>chpache</id>
            <name>Christophe Pache</name>
            <url>https://twitter.com/chpache</url>
        </developer>
    </developers>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                <version>${scala.version}</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>${log4j.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-xmljson</artifactId>
                <version>${camel.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-csv</artifactId>
                <version>${camel.version}</version>
            </dependency>

            <dependency>
                <groupId>cglib</groupId>
                <artifactId>cglib-nodep</artifactId>
                <version>${cglib.version}</version>
            </dependency>

            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>${h2.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-core</artifactId>
                <version>${camel.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-sql</artifactId>
                <version>${camel.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-spring</artifactId>
                <version>${camel.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-tx</artifactId>
                <version>${spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-aop</artifactId>
                <version>${spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
                <version>${spring.version}</version>
            </dependency>

            <!-- Test Dependencies -->

            <dependency>
                <groupId>org.specs2</groupId>
                <artifactId>specs2_2.10</artifactId>
                <version>${specs2.version}</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>com.chuusai</groupId>
                        <artifactId>shapeless_2.10.2</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.scala-lang</groupId>
                        <artifactId>scala-reflect</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-test</artifactId>
                <version>${spring.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.servicemix.bundles</groupId>
                <artifactId>org.apache.servicemix.bundles.commons-csv</artifactId>
                <version>${commons-csv.version}</version>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>



    <build>

        <pluginManagement>
            <plugins>

                <!-- bundlelization -->
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <extensions>true</extensions>

                    <executions>
                        <execution>
                            <goals>
                                <goal>bundle</goal>
                            </goals>

                            <configuration>
                                <instructions>
                                    <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                                    <Bundle-Name>${project.name}</Bundle-Name>
                                    <Bundle-Version>${project.version}</Bundle-Version>
                                    <!-- restrict to compatible scala version -->
                                    <Import-Package>scala.*;version="[2.10.3,2.11)",*</Import-Package>
                                </instructions>
                            </configuration>

                        </execution>
                    </executions>
                </plugin>

                <!-- scala -->
                <plugin>
                    <groupId>net.alchim31.maven</groupId>
                    <artifactId>scala-maven-plugin</artifactId>
                    <version>3.1.6</version>
                    <executions>
                        <!-- schedule scala/java sources compilation -->
                        <execution>
                            <id>scala-compile-first</id>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>add-source</goal>
                                <goal>compile</goal>
                            </goals>
                        </execution>

                        <execution>
                            <id>scala-test-compile</id>
                            <phase>process-test-resources</phase>
                            <goals>
                                <goal>testCompile</goal>
                            </goals>
                        </execution>

                        <execution>
                            <id>scala-docjar</id>
                            <phase>none</phase>
                        </execution>

                        <execution>
                            <id>scala-documentation</id>
                            <phase>none</phase>
                        </execution>

                    </executions>
                    <configuration>
                        <scalaVersion>${scala.version}</scalaVersion>
                        <recompileMode>incremental</recompileMode>
                        <!-- zinc server started with: zinc -start -->
                        <useZincServer>true</useZincServer>
                        <!-- JVM arguments -->
                        <jvmArgs>
                            <jvmArg>-Xms64m</jvmArg>
                            <jvmArg>-Xmx1024m</jvmArg>
                            <jvmArg>-XX:MaxPermSize=512m</jvmArg>
                        </jvmArgs>
                        <!-- javac arguments for java files -->
                        <javacArgs>
                            <javacArg>-Xlint:deprecation</javacArg>
                        </javacArgs>
                        <!-- scalac arguments -->
                        <args>
                            <arg>-unchecked</arg>
                            <arg>-deprecation</arg>
                            <arg>-feature</arg>
                            <arg>-Xlint</arg>
                        </args>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.5</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

            </plugins>
        </pluginManagement>


        <plugins>

            <!-- tests execution -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.16</version>
                <configuration>
                    <includes>
                        <include>**/*Spec.*</include>
                    </includes>
                    <argLine>-Xms64m -Xmx1024m -XX:MaxPermSize=512m</argLine>
                    <useFile>false</useFile>
                </configuration>
            </plugin>

        </plugins>

    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.16</version>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>


</project>
