<?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>org.audiveris</groupId>
    <artifactId>proxymusic</artifactId>
    <version>3.0.1</version>
    <packaging>jar</packaging>

    <name>ProxyMusic</name>
    <url>https://github.com/Audiveris/proxymusic</url>
    <description>ProxyMusic provides a binding between Java objects in memory and data formatted according to MusicXML 3.0</description>

    <licenses>
        <license>
            <name>GNU General Lesser Public License (LGPL) version 3.0</name>
            <url>http://www.gnu.org/licenses/lgpl-3.0.txt</url>
        </license>
    </licenses>

    <organization>
        <name>Audiveris Ltd</name>
        <url>http://www.audiveris.org</url>
    </organization>

    <developers>
        <developer>
            <id>hbitteur</id>
            <name>Hervé Bitteur</name>
            <email>herve.bitteur@audiveris.org</email>
            <organization>Audiveris Ltd</organization>
            <organizationUrl>http://www.audiveris.org</organizationUrl>
            <roles>
                <role>administrator</role>
                <role>developer</role>
            </roles>
            <timezone>+1</timezone>
            <properties>
                <picUrl>images/Herve-64x64.png</picUrl>
            </properties>
        </developer>
    </developers>

    <prerequisites>
        <maven>3.0</maven>
    </prerequisites>

    <!-- Source Code Management -->
    <scm>
        <connection>scm:git:git://github.com/Audiveris/proxymusic.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/Audiveris/proxymusic.git</developerConnection>
        <url>https://github.com/Audiveris/proxymusic</url>
    </scm>

    <!-- Issue management -->
    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/Audiveris/proxymusic/issues</url>
    </issueManagement>

    <!-- Continuous integration -->
    <!--    <ciManagement>
        <system>hudson</system>
        <url>http://PC-BUREAU:8080/job/ProxyMusic/</url>
    </ciManagement>-->

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <!-- Location where site is deployed - username/password for site.deployments in server.xml 
    <distributionManagement>
        <site>
            <id>proxymusic-repo</id>
            <name>Site deployments</name>
            <url>scp://kenai.com/proxymusic/website/</url>
        </site>
    </distributionManagement>
    -->

    <profiles>
        <profile>
            <id>java8-disable-strict-javadoc</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <properties>
                <javadoc.doclint.none>-Xdoclint:none</javadoc.doclint.none>
            </properties>
        </profile>
    </profiles>

    <dependencies>

        <!-- Unitary tests framework -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>

        <!-- Logging facade API (with no imposed binding) -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.10</version>
        </dependency>

        <!-- Logging bindings, just for tests -->
        <dependency>
            <scope>test</scope>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.1.2</version>
        </dependency>

    </dependencies>

    <build>
        <defaultGoal>install</defaultGoal>
        <!--        <finalName>${project.name}-${project.version}-r${hg-revision}</finalName>-->

        <extensions>
            <!-- For deploying using webdav -->
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>2.8</version>
            </extension>
        </extensions>

        <plugins>
            <!-- Enforce JDK 7 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <id>enforce-java</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>1.7</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- configure Maven to use JDK 7 for compilation -->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <testSource>1.7</testSource>
                    <testTarget>1.7</testTarget>
                </configuration>
            </plugin>

            <!-- Set system property to allow JAXB access to external schema -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>properties-maven-plugin</artifactId>
                <version>1.0-alpha-2</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>set-system-properties</goal>
                        </goals>
                        <configuration>
                            <properties>
                                <property>
                                    <name>javax.xml.accessExternalSchema</name>
                                    <value>all</value>
                                </property>
                            </properties>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Generating Java sources from schemas -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxb2-maven-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <!-- for Opus -->
                    <execution>
                        <id>xjc-opus</id>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                        <configuration>
                            <schemaFiles>opus.xsd</schemaFiles>
                            <packageName>org.audiveris.proxymusic.opus</packageName>
                            <!-- no binding customization -->
                            <bindingFiles>void.xjb</bindingFiles>
                        </configuration>
                    </execution>

                    <!-- for MusicXML -->
                    <execution>
                        <id>xjc-musicxml</id>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                        <configuration>
                            <schemaFiles>musicxml.xsd</schemaFiles>
                            <packageName>org.audiveris.proxymusic</packageName>
                            <bindingFiles>musicxml.xjb</bindingFiles>
                            <clearOutputDir>false</clearOutputDir>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Ant tasks for Hg info -->
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <exportAntProperties>true</exportAntProperties>
                            <target>
                                <property name="program.name"
                                          value="${project.name}">
                                </property>
                                <property name="program.version"
                                          value="${project.version}">
                                </property>
                                <ant antfile="ant-tasks.xml"
                                     dir="${basedir}"
                                     target="generate-program-id"
                                     inheritRefs="true" />
                            </target>
                            <sourceRoot>
                                ${project.build.directory}/generated-sources/java
                            </sourceRoot>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Entries in Jar manifest -->
            <!-- NOTA: For this, we need exportAntProperties to work correctly
            and this is not yet the case for Maven 3.0.4 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                        <manifestEntries>
                            <Implementation-Revision>${program.revision}</Implementation-Revision>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <!-- Building a Jar of sources -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Building a Jar of JavaDoc -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <!-- To avoid too many 'errors' with JDK8 doclint -->
                    <additionalparam>${javadoc.doclint.none}</additionalparam>
                </configuration>
                <version>2.10.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Building web site -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.4</version>
                <executions>
                    <execution>
                        <id>attach-descriptor</id>
                        <goals>
                            <goal>attach-descriptor</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <reportPlugins>
                        <!-- Standard maven reports -->
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-project-info-reports-plugin</artifactId>
                            <version>2.6</version>
                        </plugin>

                        <!-- JavaDoc -->
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-javadoc-plugin</artifactId>
                            <configuration>
                                <!-- To avoid too many 'errors' with JDK8 doclint -->
                                <additionalparam>${javadoc.doclint.none}</additionalparam>
                            </configuration>
                            <version>2.10.1</version>
                        </plugin>

                        <!-- Java cross references -->
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-jxr-plugin</artifactId>
                            <version>2.3</version>
                        </plugin>

                        <!-- Unitary tests report -->
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-surefire-report-plugin</artifactId>
                            <version>2.6</version>
                        </plugin>

                        <!-- Unitary tests coverage -->
<!--                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>cobertura-maven-plugin</artifactId>
                            <version>2.5.2</version>
                        </plugin>-->

                    </reportPlugins>
                </configuration>
            </plugin>
            
            <!-- Signing artifacts -->            
            <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>

            <!-- Upload artifacts to Nexus staging repository to be synced into Maven Central Repository -->
            <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>
                    <!-- <stagingProfileId>???</stagingProfileId> -->
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            
        </plugins>
    </build>
</project>
