<!--
~ Copyright 2011-2013 Thomas Bouffard (redfish4ktc)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~   http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied.  See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<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>com.github.redfish4ktc.parent</groupId>
    <artifactId>redfish4ktc-maven-oss-parent</artifactId>
    <version>5</version>
  </parent>

  <groupId>com.github.redfish4ktc.soapui</groupId>
  <artifactId>maven-soapui-extension-plugin</artifactId>
  <version>4.5.1.5</version>
  <packaging>jar</packaging>
  <name>maven-soapui-extension-plugin</name>
  <description>This plugin adds new features and bug fixes to smartbear maven-soapui-pro-plugin/maven-soapui-plugin.</description>
  <inceptionYear>2011</inceptionYear>

  <url>https://github.com/redfish4ktc/maven-soapui-extension-plugin</url>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:git@github.com:redfish4ktc/maven-soapui-extension-plugin.git</connection>
    <developerConnection>scm:git:git@github.com:redfish4ktc/maven-soapui-extension-plugin.git</developerConnection>
    <url>git@github.com:redfish4ktc/maven-soapui-extension-plugin.git</url>
    <tag>maven-soapui-extension-plugin-4.5.1.5</tag>
  </scm>
  <developers>
    <developer>
      <name>Thomas Bouffard</name>
      <id>redfish4ktc</id>
      <roles>
        <role>developer</role>
      </roles>
      <timezone>+1</timezone>
    </developer>
  </developers>
  <issueManagement>
    <system>GitHub Issues</system>
    <url>http://github.com/redfish4ktc/maven-soapui-extension-plugin/issues</url>
  </issueManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <groovyVersion>1.8.0</groovyVersion>
    <!-- also check animal-sniffer configuration -->
    <javaMinimumSupportedVersion>1.6</javaMinimumSupportedVersion>
    <mavenMinimumSupportedVersion>2.2.1</mavenMinimumSupportedVersion>
    <invokerParallelThreads>1</invokerParallelThreads>
    <!-- use a camel case property name otherwise, the maven invoker plugin won't use it while filtering -->
    <soapuiVersionCurrent>4.5.1</soapuiVersionCurrent>
    <!-- TODO fix for http://jira.codehaus.org/browse/MINVOKER-137 -->
    <invokerProfile>defaultInvokerProfile</invokerProfile>
  </properties>

  <dependencies>
    <!-- Missing in SmartBear 4.5.1 implementation -->
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>11.0</version>
    </dependency>
    <dependency>
      <groupId>eviware</groupId>
      <artifactId>maven-soapui-pro-plugin</artifactId>
      <version>${soapuiVersionCurrent}</version>
      <exclusions>
        <!-- declare groovy with regular coordinates, otherwise the maven-invoker fix (http://jira.codehaus.org/browse/MINVOKER-112)
        is not able to detect that the project already depends on groovy -->
        <exclusion>
          <groupId>groovy</groupId>
          <artifactId>groovy-all</artifactId>
        </exclusion>
        <exclusion>
          <groupId>jasperreports</groupId>
          <artifactId>jasperreports</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <!-- Adding groovy with regular coordinates (see exclusion of maven-soapui-pro-plugin)
    Forced to use the same version than in maven-invoker (due to limitation of the way this plugin perform duplicate dependency detection)
    -->
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <version>${groovyVersion}</version>
    </dependency>
    <!-- use regular maven coordinates (see #67) -->
    <dependency>
      <groupId>net.sf.jasperreports</groupId>
      <artifactId>jasperreports</artifactId>
      <version>4.0.2</version>
    </dependency>
    <dependency>
      <groupId>org.easytesting</groupId>
      <artifactId>fest-assert-core</artifactId>
      <version>2.0M10</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>1.9.5</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-project</artifactId>
      <version>${mavenMinimumSupportedVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${mavenMinimumSupportedVersion}</version>
    </dependency>
    <!-- TODO check version built with eclipse groupID -->
    <dependency>
      <groupId>org.sonatype.aether</groupId>
      <artifactId>aether-api</artifactId>
      <version>1.13.1</version>
    </dependency>
    <dependency>
      <groupId>org.sonatype.aether</groupId>
      <artifactId>aether-util</artifactId>
      <version>1.13.1</version>
    </dependency>    
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
      <resource>
        <directory>${basedir}</directory>
        <targetPath>META-INF</targetPath>
        <filtering>false</filtering>
        <includes>
          <include>LICENSE</include>
          <include>NOTICE</include>
        </includes>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>${javaMinimumSupportedVersion}</source>
          <target>${javaMinimumSupportedVersion}</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <configuration>
          <delimiters>
            <delimiter>@</delimiter>
          </delimiters>
          <useDefaultDelimiters>false</useDefaultDelimiters>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-banned-dependencies</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <bannedDependencies>
                  <searchTransitive>true</searchTransitive>
                  <excludes>
                    <!-- needed to avoid conflicts with the maven invoker plugin -->
                    <exclude>groovy</exclude>
                    <!-- artifacts with wrong pom in the soapui repository (see #67) -->
                    <exclude>jasperreports</exclude>
                    <!-- remove ui support as in SmartBear plugins (see #75) -->
                    <exclude>com.jgoodies</exclude>
                    <exclude>teamdev</exclude>
                  </excludes>
                </bannedDependencies>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestEntries>
              <Soapui-version>${soapuiVersionCurrent}</Soapui-version>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <includes>
            <include>*</include>
            <include>*.*</include>
            <include>src/**/*</include>
          </includes>
          <excludes>
            <exclude>.gitignore</exclude>
            <exclude>.travis.yml</exclude>
            <!-- modified from orginal plugin.xml generated file -->
            <exclude>src/main/resources/META-INF/maven/plugin.xml</exclude>
            <!-- Unable to add license because some files have no way to specify comments -->
            <exclude>src/it/convert-project_goal/_soapui-conf/projects/composite-project/**/*</exclude>
            <exclude>src/it/mock_goal/_soapui_conf/composite-project/**/*</exclude>
            <exclude>src/it/test_goal/runner_type/_soapui-conf/projects/composite-project/**/*</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
        <configuration>
          <signature>
            <groupId>org.codehaus.mojo.signature</groupId>
            <artifactId>java16-sun</artifactId>
            <version>1.10</version>
          </signature>
        </configuration>
        <executions>
          <execution>
            <id>animal-sniffer-check</id>
            <phase>process-classes</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>templating-maven-plugin</artifactId>
        <version>1.0-alpha-3</version>
        <executions>
          <execution>
            <id>filter-sources</id>
<!--             <phase></phase> -->
            <goals>
              <goal>filter-sources</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
<!--       <plugin> -->
<!--         <groupId>org.pitest</groupId> -->
<!--         <artifactId>pitest-maven</artifactId> -->
<!--         <version>0.27</version> -->
<!--         <configuration> -->
<!--           <targetTests> -->
<!--             <param>stormpot.*</param> -->
<!--           </targetTests> -->
<!--           <targetClasses> -->
<!--             <param>stormpot.Config</param> -->
<!--             <param>stormpot.PoolException</param> -->
<!--             <param>stormpot.qpool.*</param> -->
<!--             <param>stormpot.basicpool.*</param> -->
<!--           </targetClasses> -->
<!--           <threads>4</threads> -->
<!--         </configuration>       -->
<!--       </plugin> -->

    </plugins>

  </build>
  <profiles>
    <profile>
      <id>declareRepositories</id>
       <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <properties>
        <!-- TODO modify when fix http://jira.codehaus.org/browse/MINVOKER-137 -->
        <invokerProfile>declareRepositories</invokerProfile>
      </properties>
      <repositories>
        <repository>
          <id>eviwareRepository</id>
          <url>http://www.soapui.org/repository/maven2</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>eviwarePluginRepository</id>
          <url>http://www.soapui.org/repository/maven2</url>
        </pluginRepository>
      </pluginRepositories>
    </profile>
    <profile>
      <id>runIT</id>
       <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-invoker-plugin</artifactId>
            <configuration>
              <addTestClassPath>true</addTestClassPath>
              <debug>false</debug>
              <parallelThreads>${invokerParallelThreads}</parallelThreads>
              <showErrors>true</showErrors>
              <showVersion>true</showVersion>
              <projectsDirectory>src/it</projectsDirectory>
              <cloneClean>true</cloneClean>
              <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
              <pomIncludes>
                <pomInclude>**/pom.xml</pomInclude>
              </pomIncludes>
              <preBuildHookScript>setup</preBuildHookScript>
              <postBuildHookScript>verify</postBuildHookScript>
              <extraArtifacts>
                <!-- at least needed for soapui oss workaround for mock-as-war -->
                <extraArtifact>eviware:maven-soapui-plugin:${soapuiVersionCurrent}:jar</extraArtifact>
              </extraArtifacts>
              <!-- <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath> -->
              <!-- TODO modify when fix http://jira.codehaus.org/browse/MINVOKER-137 -->
              <!-- <settingsFile>src/it/settings.xml</settingsFile> -->
              <!-- <mergeUserSettings>true</mergeUserSettings> -->
              <profiles>
                <profile>${invokerProfile}</profile>
              </profiles>
              <!-- overide default goals as we usually configure soapui test in the integration-test phase -->
              <goals>
                <goal>clean</goal>
                <goal>verify</goal>
              </goals>
            </configuration>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>install</goal>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
            <dependencies>
              <!-- Force use of the same version than in our plugin to be sure this dependency is not added twice to the classpath -->
              <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy-all</artifactId>
                <version>${groovyVersion}</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
