<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.xspec.maven</groupId>
    <artifactId>xspec-maven-plugin</artifactId>
    <version>2.0.0-RC3</version>
    <packaging>maven-plugin</packaging>


    <name>XSpec plugin for Maven</name>
    <description>Maven plugin that executes XSpec tests. Forked from Adam Retter xspec-maven-plugin</description>
    <inceptionYear>2017</inceptionYear>
    <url>https://github.com/xspec/xspec-maven-plugin</url>


    <licenses>
        <license>
            <name>The BSD 3-Clause License</name>
            <url>http://opensource.org/licenses/BSD-3-Clause</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:https://github.com/xspec/xspec-maven-plugin.git</connection>
        <developerConnection>scm:git:https://github.com/xspec/xspec-maven-plugin.git</developerConnection>
        <url>scm:git:https://github.com/xspec/xspec-maven-plugin.git</url>
        <tag>HEAD</tag>
    </scm>

    <developers>
        <developer>
            <name>Adam Retter</name>
            <email>adam.retter@googlemail.com</email>
            <organizationUrl>http://www.adamretter.org.uk</organizationUrl>
            <timezone>GMT</timezone>
        </developer>
        <developer>
            <name>Christophe Marchand</name>
            <email>christophe@marchand.top</email>
            <organizationUrl>https://www.github.com/xspec</organizationUrl>
            <timezone>GMT+1</timezone>
        </developer>
    </developers>

    <properties>
        <!--xspec.groupId>io.xspec</xspec.groupId>
        <xspec.artifactId>xspec</xspec.artifactId>
        <xspec.version>0.5.0</xspec.version>
        <xspec.packaging>zip</xspec.packaging-->
        <schematron.groupId>io.xspec</schematron.groupId>
        <schematron.artifactId>schematron</schematron.artifactId>
        <schematron.version>2017-02-09</schematron.version>
        <schematron.packaging>zip</schematron.packaging>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.plugin-plugin.version>3.4</maven.plugin-plugin.version>
    </properties>


    <dependencies>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>3.5.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>3.5.0</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>3.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.sf.saxon</groupId>
            <artifactId>Saxon-HE</artifactId>
            <version>9.8.0-5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.xmlresolver</groupId>
            <artifactId>xmlresolver</artifactId>
            <version>0.12.5</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-log4j12</artifactId>
          <version>1.7.24</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-testing</groupId>
            <artifactId>maven-plugin-testing-harness</artifactId>
            <version>3.3.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.java.dev.stax-utils</groupId>
            <artifactId>stax-utils</artifactId>
            <version>20070216</version>
            <exclusions>
                <exclusion>
                    <groupId>com.bea.xml</groupId>
                    <artifactId>jsr173-ri</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>top.marchand.xml.maven</groupId>
            <artifactId>saxon.options.mvn.utils</artifactId>
            <version>1.1.0</version>
        </dependency>
        <dependency>
            <groupId>io.xspec</groupId>
            <artifactId>xspec</artifactId>
            <version>1.0.0</version>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.7</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>${maven.plugin-plugin.version}</version>
                    <configuration>
                        <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                    </configuration>
                    <executions>
                        <execution>
                            <id>mojo-descriptor</id>
                            <goals>
                                <goal>descriptor</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>help-goal</id>
                            <goals>
                                <goal>helpmojo</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.3</version>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.code54.mojo</groupId>
                    <artifactId>buildversion-plugin</artifactId>
                    <version>1.0.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.6</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>src/main/xsl</directory>
                <filtering>false</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>com.savage7.maven.plugins</groupId>
                <artifactId>maven-external-dependency-plugin</artifactId>
                <version>0.6-SNAPSHOT</version>
                <configuration>
                    <createChecksum>true</createChecksum>
                    <skipChecksumVerification>false</skipChecksumVerification>
                    <force>false</force>
                    <artifactItems>
                        <!--artifactItem>
                            <groupId>${xspec.groupId}</groupId>
                            <artifactId>${xspec.artifactId}</artifactId>
                            <version>${xspec.version}</version>
                            <packaging>${xspec.packaging}</packaging>
                            <downloadUrl>http://github.com/xspec/{artifactId}/archive/v{version}.{packaging}</downloadUrl>
                        </artifactItem-->
                        <!-- temporary, while waiting for schematron integration in XSpec -->
                        <artifactItem>
                            <groupId>${schematron.groupId}</groupId>
                            <artifactId>${schematron.artifactId}</artifactId>
                            <version>${schematron.version}</version>
                            <packaging>${schematron.packaging}</packaging>
                            <downloadUrl>http://github.com/Schematron/{artifactId}/releases/download/{version}/iso-schematron-xslt2.{packaging}</downloadUrl>
                        </artifactItem>
                    </artifactItems>
                </configuration>
                <executions>
                    <execution>
                        <id>clean-external-dependencies</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>clean-external</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>resolve-install-external-dependencies</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>resolve-external</goal>
                            <goal>install-external</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.10</version>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <!--artifactItem>
                                    <groupId>${xspec.groupId}</groupId>
                                    <artifactId>${xspec.artifactId}</artifactId>
                                    <version>${xspec.version}</version>
                                    <type>${xspec.packaging}</type>
                                    <overWrite>true</overWrite>
                                </artifactItem-->
                                <artifactItem>
                                    <groupId>${schematron.groupId}</groupId>
                                    <artifactId>${schematron.artifactId}</artifactId>
                                    <version>${schematron.version}</version>
                                    <type>${schematron.packaging}</type>
                                    <overWrite>true</overWrite>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <!--copy todir="${project.build.directory}/classes/xspec" verbose="true">
                                    <fileset dir="${project.build.directory}/dependency/${xspec.artifactId}-${xspec.version}/src" includes="compiler/**" />
                                    <fileset dir="${project.build.directory}/dependency/${xspec.artifactId}-${xspec.version}/src" includes="reporter/**" />
                                    <filelist dir="${project.build.directory}/dependency/${xspec.artifactId}-${xspec.version}">
                                        <file name="README.md" />
                                    </filelist>
                                </copy-->
                                <!-- temporary, while waiting for schematron integration in XSpec -->
                                <copy todir="${project.build.directory}/classes/schematron/iso-schematron" verbose="true">
                                    <fileset dir="${project.build.directory}/dependency/" includes="*.xsl" />
                                    <filelist dir="${project.build.directory}/dependency">
                                        <file name="readme.txt"/>
                                    </filelist>
                                </copy>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.code54.mojo</groupId>
                <artifactId>buildversion-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>set-properties</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                        <manifestEntries>
                            <Build-Tag>${build-tag}</Build-Tag>
                            <Git-Commit>${build-commit}</Git-Commit>
                            <Git-Commit-Abbrev>${build-commit-abbrev}</Git-Commit-Abbrev>
                            <Build-Version>${build-version}</Build-Version>
                            <Build-Timestamp>${build-tstamp}</Build-Timestamp>
                            <Source-Repository>${project.scm.connection}</Source-Repository>
                            <Description>${project.description}</Description>
                            <Website>${project.url}</Website>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
    
    <distributionManagement>
        <snapshotRepository>
            <id>xspec-io.ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>xspec-io.ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
    
    <pluginRepositories>
        <pluginRepository>
            <id>sonatype-releases</id>
            <url>http://oss.sonatype.org/content/repositories/releases</url>
        </pluginRepository>
        <pluginRepository>
            <id>clojars.org</id>
            <url>http://clojars.org/repo</url>
        </pluginRepository>
    </pluginRepositories>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                        <version>2.5.3</version>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.7</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>xspec-io.ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
