<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.github.longyg</groupId>
    <artifactId>docx4j-xhtml2word</artifactId>
    <version>${revision}</version>

    <properties>
        <revision>1.0.4</revision>
        <version.docx4j>11.4.9</version.docx4j>
        <packaging.type>jar</packaging.type>
        <!-- github server corresponds to entry in ~/.m2/settings.xml -->
        <github.global.server>github</github.global.server>
        <version.logback-classic>1.3.0-alpha14</version.logback-classic>
        <version.maven-jar-plugin>2.3.1</version.maven-jar-plugin>
        <version.maven-bundle-plugin>5.1.2</version.maven-bundle-plugin>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <packaging>pom</packaging>
    <name>docx4j-xhtml2word</name>

    <modules>
        <module>docx4j-xhtml2word-core</module>
        <module>docx4j-xhtml2word-samples</module>
    </modules>

    <description>
        docx4j-ImportXHTML converts XHTML to OpenXML WordML (docx) using docx4j
    </description>

    <url>https://github.com/longyg/docx4j-xhtml2word</url>
    <licenses>
        <license>
            <name>LGPL v2.1</name>
            <url>http://www.gnu.org/licenses/lgpl-2.1.html</url>
            <distribution>repo</distribution>
            <comments>The same license as https://github.com/danfickle/openhtmltopdf. See legals/NOTICE for details.
            </comments>
        </license>
    </licenses>
    <scm>
        <developerConnection>scm:git|git@github.com:longyg/docx4j-xhtml2word.git</developerConnection>
        <tag>HEAD</tag>
        <url>https://github.com/longyg/docx4j-xhtml2word</url>
    </scm>
    <inceptionYear>2013</inceptionYear>
    <developers>
        <developer>
            <id>jharrop</id>
            <name>Jason Harrop</name>
            <email>jharrop@plutext.com</email>
            <organization>Plutext</organization>
            <roles>
                <role>Developer</role>
            </roles>
            <timezone>+10</timezone>
        </developer>
    </developers>
    <contributors>
        <contributor>
            <name>Ivan Lozitski (ai-github)</name>
        </contributor>
        <contributor>
            <name>Basil Zabairatsky (bsl-zcs)</name>
        </contributor>
        <contributor>
            <name>Tomas Bezdek</name>
        </contributor>
        <!--  others listed in CHANGELOG.md, to be added here -->
    </contributors>


    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>

                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>flatten-maven-plugin</artifactId>
                                        <versionRange>[1.0.0,)</versionRange>
                                        <goals>
                                            <goal>flatten</goal>
                                            <goal>clean</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore/>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>


        <plugins>

            <!-- use nexus-staging-maven-plugin for deploy -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.13</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <phase>deploy</phase>
                    </execution>
                </executions>
                <configuration>
                    <serverId>oss</serverId>
                    <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>false</autoReleaseAfterClose>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <release>11</release>
                </configuration>
            </plugin>

            <!--  you can run this with: mvn validate
                  See further https://stackoverflow.com/questions/24827194/maven-enforcer-plugin-missing-or-invalid-rules

                  2019 05 25 should work with Java 11: https://github.com/mojohaus/extra-enforcer-rules/pull/63
                  but it doesn't.

                  Seems to work with Java 12 though -->

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M2</version>
                <executions>
                    <execution>
                        <id>enforce-bytecode-version</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <enforceBytecodeVersion>
                                    <maxJdkVersion>11</maxJdkVersion>
                                    <excludes>
                                        <exclude>org.mindrot:jbcrypt</exclude>
                                    </excludes>
                                </enforceBytecodeVersion>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>extra-enforcer-rules</artifactId>
                        <version>1.2</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <!-- The Source Plugin creates a jar archive of the source files of the
                    current project. -->
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Maven Central REQUIRES Javadoc

                 hiccups on org.slf4j since it is a multi-release jar
                 broken in Java 11, fixed in Java 12
                 https://bugs.openjdk.java.net/browse/JDK-8222309
             -->
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <maxmemory>512m</maxmemory>
                    <additionalJOption>-Xdoclint:none</additionalJOption>
                    <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
                    <!-- workaround for 'javadoc: error - The code being documented uses packages in the unnamed module' issue
                         still present in Java 14!
                         https://stackoverflow.com/a/63475569/1031689
                         -->
                    <source>11</source>
                    <detectJavaApiLink>false</detectJavaApiLink>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>flatten-maven-plugin</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <!--  <updatePomFile>true</updatePomFile>-->
                    <flattenMode>oss</flattenMode>
                </configuration>
                <executions>
                    <execution>
                        <id>flatten</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>flatten</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>flatten.clean</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>


    <dependencies>

        <dependency>
            <groupId>com.openhtmltopdf</groupId>
            <artifactId>openhtmltopdf-core</artifactId>
            <version>1.0.10</version>
        </dependency>
        <dependency>
            <groupId>com.openhtmltopdf</groupId>
            <artifactId>openhtmltopdf-pdfbox</artifactId>
            <version>1.0.10</version>
        </dependency>


        <dependency>
            <groupId>org.docx4j</groupId>
            <artifactId>docx4j-core</artifactId>
            <version>${version.docx4j}</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-codec</groupId>
                    <artifactId>commons-codec</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.15</version>
        </dependency>

        <dependency>
            <groupId>org.apache.james</groupId>
            <artifactId>apache-mime4j-core</artifactId>
            <version>0.8.7</version>
        </dependency>

        <!--  docx4j v11.4.0 and later use JAXB 3.0 -->
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>3.0.1</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.0-alpha6</version>
        </dependency>

        <!-- sample docx4j.properties specifies this -->
        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <version>2.12.2</version>
            <exclusions>
                <exclusion>
                    <groupId>xml-apis</groupId>
                    <artifactId>xml-apis</artifactId>
                </exclusion>
            </exclusions>
        </dependency>


        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${version.logback-classic}</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.1</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <profiles>
        <profile>
            <id>jdk-8-config</id>
            <activation>
                <jdk>1.8</jdk>
            </activation>
            <properties>
                <javadocExecutable>${java.home}/../bin/javadoc</javadocExecutable>
            </properties>
        </profile>
        <profile>
            <id>jdk-11-config</id>
            <activation>
                <jdk>[11,)</jdk>
            </activation>
            <properties>
                <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
            </properties>
        </profile>

        <profile>
            <id>OSGi</id>
            <properties>
                <packaging.type>bundle</packaging.type>
            </properties>
        </profile>

    </profiles>

    <!-- 发布中央仓库地址-->
    <distributionManagement>
        <!-- snapshotRepository 与 repository 中的 id 必须与 setting.xml 中 server 的 id 一致 -->
        <snapshotRepository>
            <id>oss</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>oss</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
    </distributionManagement>
</project>
