<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.craftercms</groupId>
    <artifactId>crafter-engine</artifactId>
    <name>Crafter Engine</name>
    <description>Crafter Content Delivery Engine</description>
    <url>https://github.com/craftercms/engine</url>
    <packaging>war</packaging>
    <version>2.5.15</version>
    <organization> 
        <name>CrafterCMS</name>
        <url>http://craftercms.org</url>
    </organization>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <servlet.api.version>3.0.1</servlet.api.version>
        <javax.mail.version>1.4.7</javax.mail.version>
        <crafter.search.version>2.5.15</crafter.search.version>
        <crafter.core.version>2.5.15</crafter.core.version>
        <crafter.profile.version>2.5.15</crafter.profile.version>
        <crafter.commons.version>2.5.15 </crafter.commons.version>
        <spring.version>4.0.3.RELEASE</spring.version>
        <commons.httpclient.version>3.1</commons.httpclient.version>
        <commons.config.version>1.10</commons.config.version>
        <commons.collections.version>4.1</commons.collections.version>
        <log4j.version>1.2.17</log4j.version>
        <cglib.version>3.1</cglib.version>
        <groovy.version>2.4.3</groovy.version>
        <gmongo.version>1.5</gmongo.version>
        <tika.version>1.5</tika.version>
        <junit.version>4.11</junit.version>
        <mockito.version>1.9.5</mockito.version>
        <rome.version>1.0</rome.version>
    </properties>

    <licenses>
        <license>
            <name>GNU GENERAL PUBLIC LICENSE, Version 3</name>
            <url>http://www.gnu.org/licenses/gpl-3.0.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>sumerjabri</id>
            <name>Sumer Jabri</name>
            <email>sumer.jabri@craftercms.org</email>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/craftercms/engine</connection>
        <developerConnection>scm:git:git://github.com/craftercms/engine</developerConnection>
        <url>scm:git:git://github.com/craftercms/engine</url>
    </scm>

    <repositories>
        <repository>
            <id>sonatype-snapshots</id>
            <name>sonatype Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
                <checksumPolicy>warn</checksumPolicy>
            </releases>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>${servlet.api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>${javax.mail.version}</version>
        </dependency>
        <dependency>
            <groupId>org.craftercms</groupId>
            <artifactId>crafter-core</artifactId>
            <version>${crafter.core.version}</version>
        </dependency>
        <dependency>
            <groupId>org.craftercms</groupId>
            <artifactId>crafter-search-client</artifactId>
            <version>${crafter.search.version}</version>
        </dependency>
        <dependency>
            <groupId>org.craftercms</groupId>
            <artifactId>crafter-search-api</artifactId>
            <version>${crafter.search.version}</version>
        </dependency>
        <dependency>
            <groupId>org.craftercms</groupId>
            <artifactId>crafter-security-provider</artifactId>
            <version>${crafter.profile.version}</version>
        </dependency>
        <dependency>
            <groupId>org.craftercms</groupId>
            <artifactId>crafter-commons-mongo</artifactId>
            <version>${crafter.commons.version}</version>
        </dependency>

        <dependency>
            <!-- TODO: Replace for Apache HttpComponents -->
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>${commons.httpclient.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>commons-configuration</groupId>
            <artifactId>commons-configuration</artifactId>
            <version>${commons.config.version}</version>
        </dependency>
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
            <version>${cglib.version}</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>${groovy.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tika</groupId>
            <artifactId>tika-core</artifactId>
            <version>${tika.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.ivy</groupId>
            <artifactId>ivy</artifactId>
            <version>2.4.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-all</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${log4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>${commons.collections.version}</version>
        </dependency>

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

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

        <!-- Test dependencies -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>ROOT</finalName>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>1.2</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                            <goal>create-timestamp</goal>

                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <doCheck>false</doCheck>
                    <doUpdate>false</doUpdate>
                    <revisionOnScmFailure>unknown</revisionOnScmFailure>
                </configuration>
            </plugin>

            <plugin>
                <inherited>true</inherited>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>install</id>
                        <phase>install</phase>
                        <goals>
                            <goal>sources</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</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <attachClasses>true</attachClasses>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                        <manifestEntries>
                            <Implementation-Build>${buildNumber}</Implementation-Build>
                            <Build-On>${timestamp}</Build-On>
                        </manifestEntries>
                    </archive>
                    <webResources>
                        <resource>
                            <directory>src/main/generated-resources/</directory>
                            <filtering>true</filtering>
                            <targetPath>WEB-INF/templates/system/common</targetPath>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <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-deploy-plugin</artifactId>
                        <version>2.7</version>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.4</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>JDK8</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.10.4</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <additionalparam>-Xdoclint:none</additionalparam>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

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