<?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>
    
    <parent>
        <groupId>org.expath.http.client</groupId>
        <artifactId>http-client-parent</artifactId>
        <version>1.3.0</version>
        <relativePath>../http-client-parent/pom.xml</relativePath>
    </parent>
    
    <artifactId>http-client-saxon</artifactId>
    <packaging>jar</packaging>
    
    <name>EXPath HTTP Client Saxon Implementation</name>
    <description>Implementation of HTTP Client module for Saxon</description>

    <scm>
        <connection>scm:git:https://github.com/expath/expath-http-client-java.git</connection>
        <developerConnection>scm:git:https://github.com/expath/expath-http-client-java.git</developerConnection>
        <url>scm:git:https://github.com/expath/expath-http-client-java.git</url>
      <tag>http-client-1.3.0</tag>
  </scm>

    <dependencies>
        <dependency>
            <groupId>org.expath.tools</groupId>
            <artifactId>tools-java</artifactId>
        </dependency>
        <dependency>
            <groupId>org.expath.tools</groupId>
            <artifactId>tools-saxon</artifactId>
            <version>0.6.0</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>http-client-java</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.expath.packaging</groupId>
            <artifactId>pkg-saxon</artifactId>
            <version>1.5.0</version>
        </dependency>
        <dependency>
            <groupId>net.sf.saxon</groupId>
            <artifactId>Saxon-HE</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
        </dependency>
        
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
            </resource>
            <resource>
                <directory>src/main/resources-filtered</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>appassembler-maven-plugin</artifactId>
                <version>2.1.0</version>
                <configuration>
                    <repositoryLayout>flat</repositoryLayout>
                    <repositoryName>lib</repositoryName>
                    <binFileExtensions>
                        <unix>.sh</unix>
                    </binFileExtensions>
                </configuration>
                <executions>
                    <execution>
                        <id>appassembler-base</id>
                        <phase>package</phase>
                        <goals>
                            <goal>assemble</goal>
                        </goals>
                        <configuration>
                            <assembleDirectory>${project.build.directory}/${project.artifactId}-${project.version}-dir</assembleDirectory>
                            <programs>
                                <program>
                                    <id>transform</id>
                                    <mainClass>net.sf.saxon.Transform</mainClass>
                                </program>
                                <program>
                                    <id>query</id>
                                    <mainClass>net.sf.saxon.Query</mainClass>
                                </program>
                            </programs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.2.0</version>

                <executions>
                    <execution>
                        <id>copy-examples</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}-dir/examples</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}/examples</directory>
                                    <filtering>false</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-scripts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}-dir/bin</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}/src/scripts</directory>
                                    <filtering>false</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <configuration>
                    <shadedArtifactAttached>true</shadedArtifactAttached>
                    <shadedClassifierName>uber</shadedClassifierName>
                    <artifactSet>
                        <excludes>
                            <exclude>net.sf.saxon:Saxon-HE</exclude>
                        </excludes>
                    </artifactSet>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>
    
</project>