<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.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
        <relativePath />
    </parent>

    <prerequisites>
        <maven>3.0.3</maven>
    </prerequisites>

    <groupId>com.moviejukebox</groupId>
    <artifactId>allocine-api</artifactId>
    <version>1.3</version>
    <packaging>jar</packaging>

    <name>API-Allocine</name>
    <description>API for the Allocine Website</description>
    <url>https://github.com/YAMJ/api-allocine</url>
    <inceptionYear>2011</inceptionYear>

    <developers>
        <developer>
            <id>yves.blusseau</id>
            <name>Yves Blusseau</name>
            <email>yves.blusseau@gmail.com</email>
            <timezone>GMT+1</timezone>
            <roles>
                <role>Lead Developer</role>
            </roles>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>GNU General Public License v3+</name>
            <url>http://www.gnu.org/licenses/gpl-3.0-standalone.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <url>scm:git:git@github.com:YAMJ/api-allocine.git</url>
        <connection>scm:git:git@github.com:YAMJ/api-allocine.git</connection>
        <developerConnection>scm:git:git@github.com:YAMJ/api-allocine.git</developerConnection>
    </scm>

    <distributionManagement>
        <site>
            <id>github-project-site</id>
            <name>GitHub Project Pages</name>
            <url>gitsite:git@github.com/YAMJ/api-allocine.git</url>
        </site>
    </distributionManagement>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/YAMJ/api-allocine/issues</url>
    </issueManagement>

    <ciManagement>
        <system>Jenkins CI</system>
        <url>http://jenkins.omertron.com/job/API-Allocine/</url>
    </ciManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <distribution.format>zip</distribution.format>
		<jaxb.version>2.2.4-1</jaxb.version>
    </properties>

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

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.1</version>
        </dependency>

        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.8</version>
        </dependency>

        <!-- JSON PARSING -->

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.2.2</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>2.2.2</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.2.2</version>
        </dependency>

        <!-- XML PARSING -->

        <dependency>
            <groupId>com.github.jaxb-xew-plugin</groupId>
            <artifactId>jaxb-xew-plugin</artifactId>
            <version>1.1</version>
        </dependency>

        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>${jaxb.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>stax-api</artifactId>
                    <groupId>javax.xml.stream</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>activation</artifactId>
                    <groupId>javax.activation</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-xjc</artifactId>
            <version>${jaxb.version}</version>
        </dependency>

        <!-- LOGGING -->

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.5</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
            <version>1.7.5</version>
            <scope>test</scope>
            <!--<scope>test</scope>-->
        </dependency>

        <!-- OTHER -->

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <finalName>${project.artifactId}-${project.version}-${buildNumber}</finalName>

        <pluginManagement>
            <plugins>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>2.7</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.9</version>
                </plugin>

            </plugins>
        </pluginManagement>

        <plugins>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>1.2</version>
                <configuration>
                    <shortRevisionLength>10</shortRevisionLength>
                    <doCheck>false</doCheck>
                    <doUpdate>false</doUpdate>
                    <timestampFormat>{0,date,yyyy-MM-dd HH:mm:ss}</timestampFormat>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Specification-Title>${project.name}</Specification-Title>
                            <Specification-Version>${project.version}</Specification-Version>
                            <Implementation-Version>${buildNumber}</Implementation-Version>
                            <Implementation-Title>${timestamp}</Implementation-Title>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.14.1</version>
                <configuration>
                    <!-- To skip tests by default -->
                    <skipTests>${skipTests}</skipTests>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.4</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <id>add-jaxb-generated-sources</id>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-sources/jaxb</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>distro-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <descriptors>
                                <descriptor>src/main/resources/bin.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <id>jaxb</id>
                        <phase>generate-sources</phase>
                        <configuration>
                            <target>
                                <mkdir dir="${project.build.directory}/generated-sources/jaxb/com/moviejukebox/allocine/jaxb" />
                                <!-- classpath for JAXB @XmlElementWrapper Plugin (xew) -->
                                <!--                                <path id="cp.plugin">
                                    <fileset dir="${basedir}/lib/xjc-plugin" includes="*.jar" />
                                </path>-->

                                <!-- Ant task definition for the xjc tool -->
                                <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask" classpathref="maven.plugin.classpath">
                                    <classpath>
                                        <path refid="maven.compile.classpath" />
                                        <!--<path refid="cp.plugin" />-->
                                    </classpath>
                                </taskdef>

                                <xjc destdir="${project.build.directory}/generated-sources/jaxb" package="com.moviejukebox.allocine.jaxb" extension="Yes">
                                    <!--<arg value="-debug" />-->
                                    <!--<arg value="-verbose" />-->
                                    <arg value="-Xxew" />
                                    <!--<arg value="-summary ${project.build.directory}/allocine-xew-summary.txt" />-->
                                    <!--<arg value="-instantiate lazy" />-->
                                    <!--<arg value="-delete" />-->
                                    <schema dir="${basedir}/src/main/schemas" includes="allocine.xsd" />
                                    <!-- <binding dir="${etc}" includes="allocine.xjb" /> -->
                                    <produces dir="${project.build.directory}/generated-sources/jaxb/com/moviejukebox/allocine/jaxb" includes="ObjectFactory.java" />
                                </xjc>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>create-version-txt</id>
                        <phase>generate-resources</phase>
                        <configuration>
                            <target>
                                <property name="version_file" value="${project.build.directory}/version.txt" />
                                <property name="header_line" value="Allocine API${line.separator}" />
                                <property name="build_date_line" value="Build Date: ${timestamp}${line.separator}" />
                                <property name="version_line" value="Version: ${project.version}${line.separator}" />
                                <property name="buildnumber_line" value="Git-SHA: ${buildNumber}${line.separator}" />
                                <echo>Writing version file: ${version_file}</echo>
                                <echo file="${version_file}" append="false">${header_line}</echo>
                                <echo file="${version_file}" append="true">${build_date_line}</echo>
                                <echo file="${version_file}" append="true">${version_line}</echo>
                                <echo file="${version_file}" append="true">${buildnumber_line}</echo>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <failOnError>true</failOnError>
                    <verbose>true</verbose>
                    <!-- excludes><exclude>**/*</exclude></excludes -->
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <reportPlugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-project-info-reports-plugin</artifactId>
                            <reports>
                                <report>index</report>
                                <report>scm</report>
                                <report>issue-tracking</report>
                                <report>help</report>
                                <report>dependency-convergence</report>
                                <report>summary</report>
                                <report>dependency-management</report>
                                <report>dependencies</report>
                                <report>license</report>
                                <report>modules</report>
                            </reports>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-javadoc-plugin</artifactId>
                        </plugin>
                    </reportPlugins>
                </configuration>
            </plugin>

        </plugins>

        <extensions>
            <extension>
                <groupId>org.apache.maven.scm</groupId>
                <artifactId>maven-scm-provider-gitexe</artifactId>
                <version>1.8.1</version>
            </extension>
            <extension>
                <groupId>org.apache.maven.scm</groupId>
                <artifactId>maven-scm-manager-plexus</artifactId>
                <version>1.8.1</version>
            </extension>
            <extension>
                <groupId>org.kathrynhuxtable.maven.wagon</groupId>
                <artifactId>wagon-gitsite</artifactId>
                <version>0.3.1</version>
            </extension>
        </extensions>

    </build>

</project>
