<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>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
        
        <!-- must be empty otherwise reads ../pom.xml by default -->
        <relativePath></relativePath>
    </parent>

    <groupId>fr.inria.gforge.spoon</groupId>
    <artifactId>spoon-pom</artifactId>
    <packaging>pom</packaging>
    <version>1.0</version>
    <name>Spoon POM</name>
    <description>Common Maven config for Spoon modules</description>
    <url>http://spoon.gforge.inria.fr/</url>
    <inceptionYear>2007</inceptionYear>

    <properties>
        <java.src.version>1.8</java.src.version>
        <java.test.version>1.8</java.test.version>
        <junit.version>4.12</junit.version>
        <runtime.log>target/velocity.log</runtime.log>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <repositories>
        <!-- This repository is actually needed for revapi to compare against the last Spoon Snapshot -->
        <repository>
            <id>maven.inria.fr-snapshot</id>
            <name>Maven Repository for Spoon Snapshots</name>
            <url>http://maven.inria.fr/artifactory/spoon-public-snapshot</url>
        </repository>
    </repositories>

    <organization>
        <name>Inria</name>
        <url>http://www.inria.fr</url>
    </organization>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/INRIA/spoon/issues</url>
    </issueManagement>

    <scm>
        <url>https://github.com/INRIA/spoon</url>
        <connection>scm:git:https://github.com/INRIA/spoon.git</connection>
        <developerConnection>scm:git:ssh://github.com/INRIA/spoon.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>maven.inria.fr-snapshot</id>
            <name>Maven Repository for Spoon Snapshots</name>
            <url>http://maven.inria.fr/artifactory/spoon-public-snapshot</url>
        </snapshotRepository>
        <site>
            <id>gforge.inria.fr-site</id>
            <name>inria</name>
            <url>scp://scm.gforge.inria.fr/home/groups/spoon/htdocs/mvnsites/spoon-core</url>
        </site>
    </distributionManagement>

    <build>
        <defaultGoal>clean install</defaultGoal>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <excludes>
                    <exclude>log4j.properties</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <includes>
                    <include>log4j.properties</include>
                </includes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.21.0</version>
                <configuration>
                    <!-- "If you want to use a basic plain old Java classpath, [...] set useManifestOnlyJar=false and useSystemClassLoader=true".
                    https://maven.apache.org/surefire/maven-surefire-plugin/examples/class-loading.html -->
                    <useSystemClassLoader>true</useSystemClassLoader>
                    <useManifestOnlyJar>false</useManifestOnlyJar>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>${java.src.version}</source>
                    <target>${java.src.version}</target>
                    <testSource>${java.test.version}</testSource>
                    <testTarget>${java.test.version}</testTarget>
                    <showWarnings>true</showWarnings>
                    <compilerArgs>
                        <arg>-Xlint:deprecation,unchecked</arg>
                        <!-- always generate class files for package-info -->
                        <arg>-Xpkginfo:always</arg>
                    </compilerArgs>
                    <!-- incremental compilation is broken in maven, see https://issues.apache.org/jira/browse/MCOMPILER-205  -->
                    <!-- useIncrementalCompilation=false actually means that we won't recompile everything each time -->
                    <!-- it's not a joke, test by yourself :-) -->
                    <useIncrementalCompilation>false</useIncrementalCompilation>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.1</version>
            </plugin>

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

            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.wagon</groupId>
                        <artifactId>wagon-ssh</artifactId>
                        <version>2.12</version>
                    </dependency>
                </dependencies>
            </plugin>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.8</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/</outputDirectory>
                            <overWriteReleases>false</overWriteReleases>
                            <overWriteSnapshots>false</overWriteSnapshots>
                            <overWriteIfNewer>true</overWriteIfNewer>
                        </configuration>
                    </execution>
                </executions>
            </plugin>


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


            <!-- Used for checking backward compatibility (binary and source) -->
            <plugin>
                <groupId>org.revapi</groupId>
                <artifactId>revapi-maven-plugin</artifactId>
                <!-- Lock down plugin version for build reproducibility -->
                <version>0.9.5</version>
                <dependencies>
                    <dependency>
                        <groupId>org.revapi</groupId>
                        <artifactId>revapi-java</artifactId>
                        <version>0.14.4</version>
                    </dependency>
                    <dependency>
                        <groupId>org.revapi</groupId>
                        <artifactId>revapi-reporter-text</artifactId>
                        <version>0.8.1</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <failSeverity>breaking</failSeverity>
                    <alwaysCheckForReleaseVersion>false</alwaysCheckForReleaseVersion>
                    <oldVersion>LATEST</oldVersion>
                    <analysisConfigurationFiles>
                        <file>../revapi.json</file>
                    </analysisConfigurationFiles>
                </configuration>
            </plugin>
        </plugins>


        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings
                  only. It has no influence on the Maven build itself. -->
                <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.8,)
                                        </versionRange>
                                        <goals>
                                            <goal>
                                                copy-dependencies
                                            </goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.0.0-M1</version>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <configuration>
                        <header>../LICENSE-short.txt</header>
                        <basedir>src</basedir>
                        <includes>
                            <include>main/java/**</include>
                            <!-- We also want to check the license in templates to generate files with the proper header -->
                            <include>test/java/spoon/generating/clone/*</include>
                        </includes>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

            </plugins>
        </pluginManagement>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
            </extension>
        </extensions>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.9</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.0.0-M1</version>
                <configuration>
                    <quiet>true</quiet>
                    <additionalparam>-Xdoclint:none</additionalparam>
                    <!--maven-javadoc-plugin version 2.9 onwards uses additionalJOption, see https://stackoverflow.com/questions/39616344/how-to-disable-javadoc-warnings-in-maven-javadoc-plugin/48511911#48511911 -->
                    <additionalJOption>-Xdoclint:none</additionalJOption>
                </configuration>
                <reportSets>
                    <reportSet>
                        <id>html</id>
                        <reports>
                            <report>javadoc</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>3.0.0</version>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>checkstyle-test</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <version>2.17</version>
                        <configuration>
                            <failsOnError>true</failsOnError>
                            <configLocation>../checkstyle-test.xml</configLocation>
                            <consoleOutput>true</consoleOutput>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>coveralls</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.eluder.coveralls</groupId>
                        <artifactId>coveralls-maven-plugin</artifactId>
                        <version>4.3.0</version>
                    </plugin>

                
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.8.1</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.3</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.0.0-M1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </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>
            </build>
        </profile>
    </profiles>

    <!-- to generate the list for the README -->
    <!-- xmlstarlet sel -t -m "//_:developer/_:name" -o "* " -v . -n  pom.xml -->
    <developers>
        <developer>
            <name>Olivier Barais</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
        <developer>
            <name>David Bernard</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
        <developer>
            <name>Benoit Cornu</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
        <developer>
            <name>Didier Donsez</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
        <developer>
            <name>Favio DeMarco</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
        <developer>
            <name>Christophe Dufour</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
        <developer>
            <name>Nicolas Harrand</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
        <developer>
            <name>Sebastian Lamelas Marcote</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
        <developer>
            <name>Matias Martinez</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
        <developer>
            <name>Martin Monperrus</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
        <developer>
            <name>Carlos Noguera</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
        <developer>
            <name>Renaud Pawlak</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
        <developer>
            <name>Nicolas Pessemier</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
        <developer>
            <name>Nicolas Petitprez</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
        <developer>
            <name>Phillip Schichtel</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
        <developer>
            <name>Lionel Seinturier</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
        <developer>
            <name>Stefan Wolf</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
        <developer>
            <name>Gérard Paligot</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
        <developer>
            <name>Alcides Fonseca</name>
            <roles>
                <role>Contributor</role>
            </roles>
        </developer>
    </developers>
</project>
