<!--
 This library is free software; you can redistribute it and/or modify it under the terms of
 the GNU Lesser General Public License as published by the Free Software Foundation;
 either version 2.1 of the License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 PURPOSE. See the GNU Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public License along with this
 library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 Boston, MA 02110-1301 USA
-->
<!-- This file is used to build and run all the examples -->
<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">
    <name>OReilly Workbook Examples</name>
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.sun.jersey.contribs</groupId>
        <artifactId>jersey-contribs</artifactId>
        <version>1.19.1</version>
    </parent>

    <groupId>com.sun.jersey.contribs.bill-burke-book</groupId>
    <artifactId>bill-burke-book-examples</artifactId>
    <version>1.19.1</version>
    <packaging>pom</packaging>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.sun.xml.bind</groupId>
                <artifactId>jaxb-impl</artifactId>
                <version>2.2.3-1</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.8.2</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <modules>
        <module>ex03_1</module>
        <module>ex04_1</module>
        <module>ex04_2</module>
        <module>ex04_3</module>
        <module>ex05_1</module>
        <module>ex05_2</module>
        <module>ex06_1</module>
        <module>ex06_2</module>
        <module>ex07_1</module>
        <module>ex08_1</module>
        <module>ex08_2</module>
        <module>ex09_1</module>
        <module>ex09_2</module>
        <module>ex10_1</module>
        <module>ex11_2</module>
    </modules>

    <profiles>
        <profile>
            <id>hudson</id>
            <activation>
                <property>
                    <name>env.JERSEY_HTTP_PORT</name>
                </property>
            </activation>
            <properties>
                <my.jetty.port>${env.JERSEY_HTTP_PORT}</my.jetty.port>
                <my.jetty.stop.port>${env.JETTY_STOP_PORT}</my.jetty.stop.port>
            </properties>
        </profile>
        <profile>
            <id>non-hudson</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <my.jetty.port>9095</my.jetty.port>
                <my.jetty.stop.port>9999</my.jetty.stop.port>
            </properties>
        </profile>
        <profile>
            <id>cobertura</id>
            <activation>
                <property>
                    <name>cobertura</name>
                </property>
            </activation>
            <properties>
                <my.jetty.port>9095</my.jetty.port>
                <my.jetty.stop.port>9999</my.jetty.stop.port>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>net.sourceforge.cobertura</groupId>
                    <artifactId>cobertura</artifactId>
                    <optional>true</optional>
                    <version>1.9.4.1</version>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>cobertura-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>cobertura-instrument</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>instrument</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>cobertura-jar</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <classifier>cobertura</classifier>
                                    <classesDirectory>${basedir}/target/generated-classes/cobertura</classesDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-install-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>cobertura-install</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>install</goal>
                                </goals>
                                <configuration>
                                    <classifier>cobertura</classifier>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3</version>
                <inherited>true</inherited>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptors>
                        <descriptor>assembly.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id> <!-- this is used for inheritance merges -->
                        <phase>package</phase> <!-- append to the packaging phase. -->
                        <goals>
                            <goal>attached</goal> <!-- goals == mojos -->
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <licenses>
        <license>
            <name>
                GNU Lesser General Public License, version 2.1
            </name>
            <url>http://www.gnu.org/licenses/lgpl-2.1.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

</project>
