<?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>simple-odf</artifactId>
    <version>0.9.0</version>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>odfdom-java</artifactId>
            <version>0.9.0</version>
        </dependency>
        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</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>
    <!-- Build Settings -->
    <build>
        <defaultGoal>install</defaultGoal>
        <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>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <archive>
                        <index>true</index>
                        <manifest>
                            <mainClass>org.odftoolkit.simple.JarManifest</mainClass>
                        </manifest>
                        <manifestEntries>
                            <version>${project.version}</version>
                        </manifestEntries>
                        <manifestSections>
                            <manifestSection>
                                <name>SIMPLE-ODF</name>
                                <manifestEntries>
                                    <SIMPLE-ODF-Name>Simple Java API for ODF(Simple ODF)</SIMPLE-ODF-Name>
                                    <SIMPLE-ODF-Version>${project.version}</SIMPLE-ODF-Version>
                                    <SIMPLE-ODF-Website>${project.url}</SIMPLE-ODF-Website>
                                    <SIMPLE-ODF-Built-By>${user.name}</SIMPLE-ODF-Built-By>
                                    <SIMPLE-ODF-Built-Date>${build.timestamp}</SIMPLE-ODF-Built-Date>
                                    <SIMPLE-ODF-Supported-ODF-Version>1.2</SIMPLE-ODF-Supported-ODF-Version>
                                </manifestEntries>
                            </manifestSection>
                        </manifestSections>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <!-- Workaround for https://jira.codehaus.org/browse/MGPG-9 -->
                    <mavenExecutorId>forked-path</mavenExecutorId>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <doctitle>Simple Java API for ODF (Simple ODF)</doctitle>
                    <links>
                        <link>https://docs.oracle.com/javase/8/docs/api/</link>
                        <link>https://xerces.apache.org/xerces-j/apiDocs/</link>
                    </links>
                    <splitindex>true</splitindex>
                    <windowtitle>Simple ODF v${project.version} - http://odftoolkit.org</windowtitle>
                    <additionalOptions>
                        <additionalOption>${javadoc.opts}</additionalOption>
                    </additionalOptions>
                    <bottom>${javadoc.bottom}</bottom>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <additionalOptions>${javadoc.opts}</additionalOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                    <systemPropertyVariables>
                        <simple.version>${project.version}</simple.version>
                        <simple.timestamp>${build.timestamp}</simple.timestamp>
                    </systemPropertyVariables>
                </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>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
                <executions>
                    <execution>
                        <id>single</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <extensions>
            <extension>
                <groupId>org.jvnet.wagon-svn</groupId>
                <artifactId>wagon-svn</artifactId>
                <version>1.12</version>
            </extension>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-webdav-jackrabbit</artifactId>
                <version>3.4.3</version>
            </extension>
        </extensions>
    </build>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <doctitle>Simple Java API for ODF(Simple ODF)</doctitle>
                    <minmemory>512m</minmemory>
                    <maxmemory>1024m</maxmemory>
                    <links>
                        <link>https://xerces.apache.org/xerces-j/apiDocs/</link>
                    </links>
                    <splitindex>true</splitindex>
                    <windowtitle>Simple ODF API v${project.version} - http://odftoolkit.org/</windowtitle>
                    <additionalOptions>
                        <additionalOption>${javadoc.opts}</additionalOption>
                    </additionalOptions>
                    <bottom>${javadoc.bottom}</bottom>
                </configuration>
            </plugin>
            <!-- 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>
            <!-- Reporting integration test results -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.22.1</version>
                <reportSets>
                    <reportSet>
                        <id>integration-tests</id>
                        <reports>
                            <report>integration-test</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>
    <!-- More Project Information -->
    <name>Simple Java API for ODF (Simple ODF)</name>
    <description>A simple API for easy manipulation of ODF documents.</description>
    <url>https://odftoolkit.org/simple/index.html</url>
    <inceptionYear>2010</inceptionYear>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </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/simple</url>
        <tag>0.9.0</tag>
    </scm>
    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>release</name>
                    <value />
                </property>
            </activation>
            <build>
                <plugins>
                    <!--
                        We want to deploy the artifact to a staging location for perusal
                    -->
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <configuration>
                            <descriptorRefs>
                                <descriptorRef>jar-with-dependencies</descriptorRef>
                            </descriptorRefs>
                        </configuration>
                        <executions>
                            <execution>
                                <id>single</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <inherited>true</inherited>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <configuration>
                            <altDeploymentRepository>${deploy.altRepository}</altDeploymentRepository>
                            <updateReleaseInfo>true</updateReleaseInfo>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>integration-test</id>
            <activation>
                <property>
                    <name>integration-test</name>
                </property>
            </activation>
            <build>
                <defaultGoal>verify</defaultGoal>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>2.22.1</version>
                        <executions>
                            <execution>
                                <id>failsafe-it</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                                <configuration>
                                    <classesDirectory>${basedir}/target/simple-odf.jar</classesDirectory>
                                    <systemPropertyVariables>
                                        <testresourcefolder>performance</testresourcefolder>
                                        <executetimes>1</executetimes>
                                        <testflag>test</testflag>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <!-- Explizit version required for fix on systemPropertyVariables -->
                        <version>2.22.2</version>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <source>${jdk.version}</source>
                            <target>${jdk.version}</target>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!--
            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-1321
        -->
        <profile>
            <id>release-javadoc</id>
            <activation>
                <property>
                    <name>deploy</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <defaultGoal>site</defaultGoal>
            </build>
            <properties>
                <project.reporting.outputDirectory>target/site/apidocs</project.reporting.outputDirectory>
            </properties>
        </profile>
        <!-- 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>
