<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
-->
<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.odftoolkit</groupId>
        <artifactId>odftoolkit</artifactId>
        <version>0.9.0</version>
    </parent>
    <artifactId>odfvalidator</artifactId>
    <version>0.9.0</version>
    <packaging>war</packaging>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>odfdom-java</artifactId>
            <version>0.9.0</version>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>net.java.dev.msv</groupId>
            <artifactId>msv-core</artifactId>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.jopendocument/isorelax-jaxp-bridge-ILM -->
        <dependency>
            <groupId>org.jopendocument</groupId>
            <artifactId>isorelax-jaxp-bridge-ILM</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.ec4j.maven/editorconfig-maven-plugin
        <dependency>
            <groupId>org.ec4j.maven</groupId>
            <artifactId>editorconfig-maven-plugin</artifactId>
            <scope>test</scope>
        </dependency>        -->
    </dependencies>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss</maven.build.timestamp.format>
    </properties>

    <!--
      The POM of org.iso_relax.verifier.jaxp.validation:isorelax-jaxp-bridge:jar:1.0
      on the central repo is not 4.0.0 complaint so that we should pick the one SMX
      Repo already provides, as otherwise building under Maven 3.0.4 would fail!
      So delete any old .m2 cache entries of yours for this artifact beforehand if
      you make use of Maven 3.0.4+
    -->
    <repositories>
        <repository>
            <id>apache.smx.repo</id>
            <url>http://svn.apache.org/repos/asf/servicemix/m2-repo/</url>
            <name>Apache ServiceMix Repo</name>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>

    <!-- Build Settings -->
    <build>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-webdav-jackrabbit</artifactId>
                <version>3.4.3</version>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <!-- defined in the parent pom.xml -->
                    <source>${jdk.version}</source>
                    <target>${jdk.version}</target>
                    <meminitial>512m</meminitial>
                    <maxmem>1024m</maxmem>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>

            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <version>4.0.5</version>
                <executions>
                    <execution>
                        <id>get-the-git-infos</id>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                        <phase>initialize</phase>
                    </execution>
                </executions>
                <configuration>
                    <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <doctitle>Validator</doctitle>
                    <links>
                        <link>http://download.oracle.com/javase/8/docs/api/</link>
                        <link>http://xerces.apache.org/xerces-j/apiDocs/</link>
                    </links>
                    <splitindex>true</splitindex>
                    <windowtitle>Validator API v${project.version} - https://odftoolkit.org/</windowtitle>
                    <bottom>${javadoc.bottom}</bottom>
                    <additionalOptions>${javadoc.opts}</additionalOptions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.3.1</version>
                <configuration>
                    <archive>
                        <index>true</index>
                        <manifestEntries>
                            <version>${project.version}</version>
                        </manifestEntries>
                        <manifestSections>
                            <manifestSection>
                                <name>ODFVALIDATOR</name>
                                <manifestEntries>
                                    <ODFVALIDATOR-Name>odfvalidator</ODFVALIDATOR-Name>
                                    <ODFVALIDATOR-Version>${project.version}</ODFVALIDATOR-Version>
                                    <ODFVALIDATOR-SCM>${git.commit.id}</ODFVALIDATOR-SCM>
                                    <ODFVALIDATOR-Website>${project.url}</ODFVALIDATOR-Website>
                                    <ODFVALIDATOR-Built-Date>${build.timestamp}</ODFVALIDATOR-Built-Date>
                                    <ODFVALIDATOR-Supported-Odf-Version>1.2</ODFVALIDATOR-Supported-Odf-Version>
                                </manifestEntries>
                            </manifestSection>
                        </manifestSections>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <!-- Workaround for http://jira.codehaus.org/browse/MGPG-9 -->
                    <mavenExecutorId>forked-path</mavenExecutorId>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                    <excludes>
                        <exclude>**/*.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <version>${project.version}</version>
                            <Main-Class>org.odftoolkit.odfvalidator.Main</Main-Class>
                        </manifestEntries>
                        <manifestSections>
                            <manifestSection>
                                <name>ODFVALIDATOR</name>
                                <manifestEntries>
                                    <ODFVALIDATOR-Name>odfvalidator</ODFVALIDATOR-Name>
                                    <ODFVALIDATOR-Version>${project.version}</ODFVALIDATOR-Version>
                                    <ODFVALIDATOR-SCM>${git.commit.id}</ODFVALIDATOR-SCM>
                                    <ODFVALIDATOR-Website>${project.url}</ODFVALIDATOR-Website>
                                    <ODFVALIDATOR-Built-Date>${build.timestamp}</ODFVALIDATOR-Built-Date>
                                    <ODFVALIDATOR-Supported-Odf-Version>1.2</ODFVALIDATOR-Supported-Odf-Version>
                                </manifestEntries>
                            </manifestSection>
                        </manifestSections>
                    </archive>
                    <descriptors>
                        <descriptor>src/main/assembly/src.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>single</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                    <includes>
                        <include>**/*.java</include>
                    </includes>
                    <systemPropertyVariables>
                        <odfvalidator.version>${project.version}</odfvalidator.version>
                        <org.odftoolkit.odfdom.validation>org.odftoolkit.odfdom.pkg.DefaultErrorHandler</org.odftoolkit.odfdom.validation>
                    </systemPropertyVariables>
                </configuration>
                <executions>
                    <execution>
                        <id>failsafe-it</id>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <reporting>
        <plugins>
            <!-- Code Coverage Testing generated by Cobertura
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <instrumentation>
                        <excludes>
                            <exclude>org/odftoolkit/**/*Test.class</exclude>
                        </excludes>
                    </instrumentation>
                </configuration>
            </plugin>-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <doctitle>Validator</doctitle>
                    <links>
                        <link>https://download.oracle.com/javase/8/docs/api/</link>
                        <link>https://xerces.apache.org/xerces-j/apiDocs/</link>
                    </links>
                    <doclint>none</doclint>
                    <splitindex>true</splitindex>
                    <validateLinks>true</validateLinks>
                    <windowtitle>Validator API v${project.version} - https://odftoolkit.org/</windowtitle>
                </configuration>
            </plugin>
            <!-- Reporting integration test results -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.22.2</version>
                <reportSets>
                    <reportSet>
                        <id>integration-tests</id>
                        <reports>
                            <report>integration-test</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

    <!-- More Project Information -->
    <name>ODF Validator</name>
    <description>
        ODF Validator is a tool that validates OpenDocument files and checks them for certain conformance criteria.
    </description>
    <url>https://odftoolkit.org/ODFValidator.html</url>
    <inceptionYear>2008</inceptionYear>
    <licenses>
        <license>
            <name>Apache 2</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    <organization>
        <name>The Document Foundation</name>
        <url>https://www.documentfoundation.org/</url>
    </organization>
    <scm>
        <connection>scm:git:git://github.com/tdf/odftoolkit.git</connection>
        <developerConnection>scm:git:git@github.com:tdf/odftoolkit.git</developerConnection>
        <url>https://github.com/tdf/odftoolkit/tree/trunk/validator</url>
        <tag>0.9.0</tag>
    </scm>
    <profiles>
        <!-- Profile for deploying to the Sonatype repository, which
        requires GPG signatures
        see
        https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide
        https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven
        https://issues.sonatype.org/browse/OSSRH-960
        -->
        <!-- GPG Signature on release -->
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>gpg.keyname</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <!-- see http://maven.apache.org/plugins/maven-gpg-plugin/usage.html -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>release-sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <!-- Add GPG passphrase in Maven settings.xml under .m2 home, see
                                        https://dzone.com/articles/publish-your-artifacts-to-maven-central -->
                                    <keyname>${gpg.keyname}</keyname>
                                    <passphraseServerId>${gpg.keyname}</passphraseServerId>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>doclint-java8-disable</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <properties>
                <javadoc.opts>-Xdoclint:none</javadoc.opts>
            </properties>
        </profile>
    </profiles>
</project>
