<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>
    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>
    <groupId>org.chorusbdd</groupId>
    <artifactId>chorus</artifactId>
    <packaging>jar</packaging>
    <version>2.0.1</version>
    <name>chorus</name>
    <url>http://www.chorus-bdd.org</url>
    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://opensource.org/licenses/MIT</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <scm>
        <connection>scm:git:git@github.com:Chorus-bdd/Chorus.git</connection>
        <developerConnection>scm:git:git@github.com:Chorus-bdd/Chorus.git</developerConnection>
        <url>git@github.com:Chorus-bdd/Chorus.git</url>
    </scm>
    <build>

        <!-- Copy chorus resources from the test/features and test/junit subtree, so resource files
        required by a handlers can be local to the .java, rather than residing in
        a separate tree under test/resources, although the default test/resources location
        is still supported -->
        <testResources>
            <testResource>
                <directory>src/test/features</directory>
                <includes>
                    <include>**/*.xml</include>
                    <include>**/*.properties</include>
                    <include>**/*.feature</include>
                    <include>**/*.txt</include>
                </includes>
            </testResource>

            <testResource>
               <directory>src/test/junit</directory>
                 <includes>
                   <include>**/*.xml</include>
                   <include>**/*.properties</include>
                   <include>**/*.feature</include>
                   <include>**/*.txt</include>
                 </includes>
             </testResource>

            <!-- include the standard test/resources directory, this is still supported
            if you don't want to put resources within the test/java subtree -->
            <testResource>
               <directory>src/test/resources</directory>
            </testResource>
        </testResources>


        <!-- Since we have separated our junit tests from our chorus handlers,
        we need to configure both directories as test source directories -->
        <plugins>

            <!-- build an uber-jar from chrous module dependencies -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <artifactSet>
                        <excludes>
                            <exclude>junit:junit</exclude>
                            <exclude>org.apache.ant:*</exclude>
                            <exclude>org.hamcrest:*</exclude>
                        </excludes>
                    </artifactSet>
                    <!-- put your configurations here -->
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>

                <configuration>
                  <source>1.7</source>
                  <target>1.7</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.4</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.1.2</version>
                <executions>
                  <execution>
                    <id>attach-sources</id>
                    <goals>
                      <goal>jar</goal>
                    </goals>
                  </execution>
                </executions>
            </plugin>

            <plugin>
               <groupId>org.codehaus.mojo</groupId>
               <artifactId>build-helper-maven-plugin</artifactId>
               <version>1.7</version>
               <executions>
                 <execution>
                   <id>add-source</id>
                   <phase>generate-sources</phase>
                   <goals>
                     <goal>add-test-source</goal>
                   </goals>
                   <configuration>
                     <sources>
                       <source>src/test/junit</source>
                       <source>src/test/features</source>
                     </sources>
                   </configuration>
                 </execution>
               </executions>
             </plugin>

            <plugin>
                <groupId>com.mycila.maven-license-plugin</groupId>
                <artifactId>maven-license-plugin</artifactId>
                <version>1.9.0</version>
                <configuration>
                    <header>src/etc/header.txt</header>
                    <includes>
                        <include>src/main/java/**/*.java</include>
                        <include>src/test/junit/**/*.java</include>
                        <include>src/test/features/**/*.java</include>
                    </includes>
                    <properties>
                        <year>2015</year>
                    </properties>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.17</version>
            </plugin>
        </plugins>

    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.8.1</version>
            </plugin>
        </plugins>
    </reporting>

    <dependencies>

        <!-- chorus internal dependencies -->

        <dependency>
            <groupId>org.chorusbdd</groupId>
            <artifactId>chorus-handlers</artifactId>
            <version>2.0.1</version>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.chorusbdd</groupId>
            <artifactId>chorus-interpreter</artifactId>
            <version>2.0.1</version>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.chorusbdd</groupId>
            <artifactId>chorus-processes</artifactId>
            <version>2.0.1</version>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.chorusbdd</groupId>
            <artifactId>chorus-remoting</artifactId>
            <version>2.0.1</version>
            <optional>true</optional>
        </dependency>

        <!-- In general the philosophy is that because Chorus is a library, we are trying to
        avoid any mandatory dependencies on other libraries, otherwise components using Chorus would be forced
        to inherit those extra dependencies

        For this reason Spring features have been pushed down into Chorus-Spring module,
        and certain other features into Chorus-tools. Users seeking to run an interpreter with
        these features enabled need to declare dependencies on these derived modules, as appropriate

        The basic Chorus interpreter and the JMX remoting feature should run just fine with the
        main chorus.jar and the JDK -->

        <!-- Optional Dependencies -->

        <!-- Ant is not required unless you make use of ChorusTask, so it is an optional dependency -->
        <!-- There should be no requirement for ant dependencies outside ChorusTask -->
        <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant</artifactId>
            <version>1.8.2</version>
            <optional>true</optional>
        </dependency>

        <!-- junit is now an optional dependency, but not a test dependency since used in ChorusSuite -

        We are using ChorusAssert to avoid a mandatory dependency on junit from the core interpreter
        although client application can use and throw JUnit assertion errors if they prefer to do so -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <optional>true</optional>
        </dependency>

        <!-- Test dependencies -->

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.9.5</version>
            <scope>test</scope>
        </dependency>

    </dependencies>
</project>
