<?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">
    <parent>
        <artifactId>parent-pom</artifactId>
        <groupId>com.cloudseal.client</groupId>
        <version>1.2.7</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>rest-client</artifactId>
    <packaging>jar</packaging>

    <properties>
        <xjc.dir>/Applications/Java/jaxb</xjc.dir>
        <xjc.exe>/Applications/Java/jaxb/bin/xjc.sh</xjc.exe>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.2.1</version>
        </dependency>

        <!-- Logging -->
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
        </dependency>

        <!-- Test deps -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.9.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <!-- <phase>generate-sources</phase> -->
                    </execution>
                </executions>
                <configuration>
                    <executable>${xjc.exe}</executable>
                    <commandlineArgs><![CDATA[-cp ${xjc.dir}/lib/xew.jar -Xxew -Xxew:instantiate lazy -extension -enableIntrospection -d src/main/java -p com.cloudseal.rest.jaxb src/main/resources]]></commandlineArgs>
                    <workingDirectory>${basedir}</workingDirectory>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.8.1</version>
                <configuration>
                    <links>
                        <link>http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/</link>
                    </links>
                    <overview>src/main/java/overview.html</overview>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>archive</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <!-- Produce a zip/tar.gz containing Cloudseal valve and dependent jars -->
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <version>2.2.1</version>
                        <configuration>
                            <descriptors>
                                <descriptor>src/main/assembly/assembly.xml</descriptor>
                            </descriptors>
                        </configuration>
                        <executions>
                            <execution>
                                <id>make-assembly</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>