<?xml version="1.0" encoding="UTF-8"?>
<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>

    <groupId>ch.epfl.bbp.nlp</groupId>
    <artifactId>bluima_parent</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>
    <name>Bluima Parent POM</name>
    <description>Parent POM for bluima project, including common dependencies and repositories</description>

    <organization>
        <name>Bluebrain Project</name>
        <url>bluebrain.epfl.ch</url>
    </organization>
    <developers>
        <developer>
            <name>Renaud Richardet</name>
            <email>renaud.richardet@epfl.ch</email>
        </developer>
        <developer>
            <name>Jean-Cedric Chappelier</name>
            <email>jean-cedric.chappelier@epfl.ch</email>
        </developer>
        <developer>
            <name>Martin Telefont</name>
            <email>martin.telefont@epfl.ch</email>
        </developer>
        <developer>
            <name>Joelle Portmann</name>
            <email>joelle.portmann@epfl.ch</email>
        </developer>
        <developer>
            <name>Marc Zimmermann</name>
            <email>marc.zimmermann@epfl.ch</email>
        </developer>
        <developer>
            <name>Orianne Rollier</name>
            <email>orianne.rollier@epfl.ch</email>
        </developer>
        <developer>
            <name>Favrod Philémon</name>
            <email>philemon.favrod@epfl.ch</email>
        </developer>
        <developer>
            <name>Erick Michael Cobos Tandazo</name>
            <email>erick.cobos@epfl.ch</email>
        </developer>
        <developer>
            <name>Marco Antognini</name>
            <email>marco.antognini@epfl.ch</email>
        </developer>
    </developers>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>


    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>
    <scm>
        <connection>scm:git:git@github.com:BlueBrain/bluima</connection>
        <developerConnection>scm:git:git@github.com:BlueBrain/bluima</developerConnection>
        <url>http://github.com/BlueBrain/bluima</url>
    </scm>
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <uimaDependencyVersion>2.4</uimaDependencyVersion>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
        <scala.version>2.10.4</scala.version>
        <scala.main.version>2.10</scala.main.version>
        <jetty.maven.version>7.1.6.v20100715</jetty.maven.version>
        <jersey.version>1.7</jersey.version>
        <jackson.version>1.7.7</jackson.version>
        <slf4j.version>1.6.5</slf4j.version>
    </properties>

    <modules>
        <!-- utils and typesystem: do not depend on parent nor UIMA -->
        <module>utils/blue_commons</module>
        <module>utils/pdf_glyph_mapping</module>
        <module>utils/mallet_utils</module>
        <module>modules/bluima_typesystem</module>

        <!-- modules: depend on this parent -->
        <module>modules/bluima_utils</module>
        <module>modules/bluima_xml</module>
        <module>modules/bluima_scripting</module>
        <module>modules/bluima_jython</module>
        <module>modules/bluima_db</module>
        <module>modules/bluima_units</module>
        <module>modules/bluima_lexica</module>
        <module>modules/bluima_commons</module>
        <module>modules/bluima_opennlp</module>
        <module>modules/bluima_banner</module>
        <module>modules/bluima_oscar4</module>
        <module>modules/bluima_fusion</module>
        <module>modules/bluima_topic_models</module>
        <module>modules/bluima_abbreviations</module>
        <module>modules/bluima_corpora</module>
        <module>modules/bluima_pubmed_ws</module>
        <module>modules/bluima_pdf</module>
        <module>modules/bluima_mongodb</module>
        <module>modules/bluima_elasticsearch</module>
        <module>modules/bluima_regions</module>
        <module>modules/bluima_jsre</module>
        <module>modules/bluima_text2pmid</module>
        <module>modules/bluima_references_classifier</module>
        <module>modules/bluima_protein_concentrations</module>
        <!-- <module>modules/bluima_rabbit</module> -->
        <module>modules/bluima_neuroner</module>

        <module>modules/bluima_bbp</module>
        <!-- <module>modules/bluima_release</module> -->

    </modules>

    <build>
        <plugins>
            <!-- compile with java 1.7 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <encoding>UTF-8</encoding>
                    <systemProperties>
                        <property>
                              <name>bluima_home</name>
                             <value>${bluima_home}</value>
                        </property>
                    </systemProperties>
                </configuration>
            </plugin>
            <!-- more memory & set resource directory for tests -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18.1</version>
                <configuration>
                    <argLine>-Xms1G -Xmx2G</argLine>
                    <systemPropertyVariables>
                        <BLUIMA_RESOURCE_DIR>${project.parent.basedir}/resources/</BLUIMA_RESOURCE_DIR>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <!-- attach sources to jars-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Add git revision number -->
            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <version>2.1.11</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>revision</goal>
                         </goals>
                    </execution>
                </executions>
                <configuration>
                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
                    <generateGitPropertiesFilename>src/main/resources/git.properties</generateGitPropertiesFilename>
				</configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>

                <!-- nexus release -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5</version>
                    <configuration>
                        <useReleaseProfile>false</useReleaseProfile>
                        <releaseProfiles>release</releaseProfiles>
                        <goals>deploy</goals>
                    </configuration>
                </plugin>

                <!-- prevents error in eclipse m2e plugin -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-dependency-plugin</artifactId>
                                        <versionRange>[2.0,)</versionRange>
                                        <goals>
                                            <goal>copy-dependencies</goal>
                                            <goal>unpack</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <!-- DEPENDENCIES SHARED AMONG ALL BLUE_UIMA MODULES -->
    <dependencies>

        <!-- COMMON UTILS -->
        <dependency>
            <artifactId>bluima_typesystem</artifactId>
            <groupId>${project.groupId}</groupId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <artifactId>blue_commons</artifactId>
            <groupId>${project.groupId}</groupId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>18.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-math3</artifactId>
            <version>3.0</version>
        </dependency>

        <!-- UIMA -->
        <dependency>
            <groupId>org.apache.uima</groupId>
            <artifactId>ruta-core</artifactId>
            <!-- <version>2.2.1-SNAPSHOT</version> -->
            <version>2.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.uima</groupId>
            <artifactId>RegularExpressionAnnotator</artifactId>
            <version>2.3.2-BBP</version>
        </dependency>
        <dependency>
            <groupId>org.apache.uima</groupId>
            <artifactId>SnowballAnnotator</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.uima</groupId>
            <artifactId>ConceptMapper</artifactId>
            <version>2.3.1</version>
        </dependency>

        <!-- LOGGING -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>1.6.5</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.0.6</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.6.5</version>
        </dependency>

        <!-- TESTING -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>ren_googlecode</id>
            <url>https://ren-maven-repo.googlecode.com/git/snapshots/</url>
        </repository>
        <repository>
            <name>Github personal repo (renaudr)</name>
            <id>renaudr</id>
            <url>https://github.com/renaud/maven_repo/raw/master/snapshots</url>
        </repository>
        <repository>
            <name>Github personal repo (renaudr)</name>
            <id>renaudr2</id>
            <url>https://raw.github.com/renaud/maven_repo/master/snapshots</url>
        </repository>
        <repository>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>central</id>
            <name>Maven Repository Switchboard</name>
            <url>http://repo1.maven.org/maven2</url>
        </repository>
        <repository>
            <id>apache snapshots</id>
            <url>http://people.apache.org/repo/m2-snapshot-repository/</url>
        </repository>
        <repository>
            <id>apache snapshots2</id>
            <url>http://repository.apache.org/snapshots/</url>
        </repository>
        <repository>
            <id>ApacheIncubatorRepository</id>
            <url>http://people.apache.org/repo/m2-incubating-repository/</url>
        </repository>
        <repository>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>JBoss</id>
            <name>jboss-maven2-release-repository</name>
            <url>https://oss.sonatype.org/content/repositories/JBoss</url>
        </repository>
        <repository>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <name>Old OpenNLP repo</name>
            <id>old-opennlp</id>
            <url>http://opennlp.sourceforge.net/maven2/</url>
        </repository>
        <repository>
            <id>com.springsource.repository.bundles.release</id>
            <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
            <url>http://repository.springsource.com/maven/bundles/release</url>
        </repository>
        <repository>
            <id>com.springsource.repository.bundles.external</id>
            <name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
            <url>http://repository.springsource.com/maven/bundles/external</url>
        </repository>
        <repository>
            <id>cleartk-googlecode</id>
            <name>ClearTK Google Code repository</name>
            <url>http://cleartk.googlecode.com/svn/repo/</url>
        </repository>
        <repository>
            <id>scala-tools.org</id>
            <name>Scala-Tools Maven2 Repository</name>
            <url>http://nexus.scala-tools.org/content/repositories/releases</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <name>Github personal repo (renaudr)</name>
            <id>renaudr</id>
            <url>https://github.com/renaud/maven_repo/raw/master/snapshots</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
                <checksumPolicy>warn</checksumPolicy>
            </releases>
        </pluginRepository>
    </pluginRepositories>

    <profiles>
        <profile>
            <id>appassembler_release</id>
            <build>
                <plugins>
                    <!-- copy resources -->
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <version>2.5</version>
                        <executions>
                            <execution>
                                <id>duplicate-resources-to-appassembler_release</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <encoding>UTF-8</encoding>
                                    <outputDirectory>${appassembler.resources}/modules/${project.artifactId}/src/main/resources</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/main/resources</directory>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>

                            <!-- needed by lexica... TODO move to resources folder -->
                            <execution>
                                <id>duplicate-resources-to-appassembler_release2_TODO</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <encoding>UTF-8</encoding>
                                    <outputDirectory>${appassembler.resources}/modules/${project.artifactId}/desc</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>desc</directory>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                            <!-- COPY STATIC MODULE RESOURCES (that don't belong to the jar) -->
                            <execution>
                                <id>duplicate-resources-to-appassembler_release3_TODO</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <encoding>UTF-8</encoding>
                                    <outputDirectory>${appassembler.resources}/modules/${project.artifactId}/resources</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>resources</directory>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- create javadocs -->
                    <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-javadoc-plugin</artifactId>
                      <version>2.9.1</version>
                      <executions>
                        <execution>
                          <id>attach-javadocs</id>
                          <goals>
                            <goal>jar</goal>
                          </goals>
                        </execution>
                      </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.3</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                            <stagingProfileId>864df237df1ef3</stagingProfileId>
                        </configuration>
                    </plugin>
                    <!--GPG for Nexus -->
                     <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>
            </build>
        </profile>
    </profiles>
</project>
