<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ Copyright 2005-2007 Vincent Massol.
  ~
  ~ 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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-extensions-maven2</artifactId>
    <version>1.0</version>
  </parent>
  <artifactId>cargo-maven2-plugin</artifactId>
  <name>Cargo Maven 2 Plugin</name>
  <packaging>maven-plugin</packaging>
  <description>Cargo Maven 2 Plugin</description>
  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>2.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-project</artifactId>
      <version>2.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-settings</artifactId>
      <version>2.0</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <version>1.4.7</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.cargo</groupId>
      <artifactId>cargo-core-api-container</artifactId>
      <version>${cargo.core.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>jmock</groupId>
      <artifactId>jmock</artifactId>
      <version>1.0.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-vfs</groupId>
      <artifactId>commons-vfs</artifactId>
      <version>1.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <!--plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin-->
      <plugin>
        <groupId>org.codehaus.modello</groupId>
        <artifactId>modello-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>xpp3-writer</goal>
              <goal>java</goal>
              <goal>xpp3-reader</goal>
            </goals>
            <configuration>
              <version>1.0.0</version>
              <models><model>src/main/mdo/mergeinfo.mdo</model></models>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-plugin-plugin</artifactId>
        <configuration>
          <!-- Note: This is to allow typing "mvn cargo:[goalname]" without having to type the 
               fully qualified name on the command line -->
          <goalPrefix>cargo</goalPrefix>
        </configuration>
      </plugin>
     </plugins>
  </build>
  <profiles>
    <profile>
      <id>integration-test</id>
	    <pluginRepositories>
	    <!-- added for maven-plugin-management-plugin -->
	    <pluginRepository>
	      <id>apache.snapshots</id>
	      <snapshots>
	        <enabled>true</enabled>
	      </snapshots>
	      <url>http://people.apache.org/maven-snapshot-repository</url>
	      <releases>
	        <enabled>false</enabled>
	      </releases>
	    </pluginRepository>
	  </pluginRepositories>
      <build>
        <plugins>
          <!-- stages the plugin so it can be used in integration-tests by the invoker plugin -->
	  <!-- Disabling management plugin as it appears to too old and is no longer available in any repos -->
<!--	      <plugin>
	        <groupId>org.apache.maven.plugins</groupId>
	        <artifactId>maven-plugin-management-plugin</artifactId>
	        <version>1.0-SNAPSHOT</version>
	        <executions>
	          <execution>
	            <goals>
	              <goal>stage</goal>
	              <goal>unstage</goal>
	            </goals>
	          </execution>
	        </executions>
	      </plugin> -->
	      <plugin>
	        <artifactId>maven-invoker-plugin</artifactId>
	        <executions>
	          <execution>
	            <id>default</id>
	            <phase>integration-test</phase>
	            <goals>
	              <goal>run</goal>
	            </goals>
	            <configuration>
	              <goals>
	                <goal>clean</goal>
	                <goal>integration-test</goal>
	              </goals>
	              <pomIncludes>
	                <pomInclude>*/pom.xml</pomInclude>
	              </pomIncludes>
	              <pomExcludes>
	                <!-- these tests needs fixing -->
	                <pomExclude>testStartAndAutoDeploy/pom.xml</pomExclude>
	                <!-- will have to run on container with ear support -->
	                <pomExclude>testStartWithOneWarOneEarDeployed/pom.xml</pomExclude>
	                <!-- disable these for now as these tests need some javacode and to be
	                executed by the embedder plugin instead -->              
	                <pomExclude>testRemoteDeploy/pom.xml</pomExclude>
	                <pomExclude>testStartInplaceDevelopment/pom.xml</pomExclude>
	                <pomExclude>testStartMultipleContainers/pom.xml</pomExclude>
	                <pomExclude>testStartUsingAlreadyInstalledContainer/pom.xml</pomExclude>
	                <pomExclude>testStartWithNoDeployableAndInBlockingMode/pom.xml</pomExclude>
	                <pomExclude>testStopEmbeddedContainerInAnotherExecution/pom.xml</pomExclude>
	              </pomExcludes>
	            </configuration>
	          </execution>
	        </executions>
	      </plugin>          
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
