<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>
  <groupId>org.kohsuke</groupId>
  <artifactId>maven-junit-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  <version>1.9</version>
  <name>maven-junit-plugin Maven Mojo</name>
  <description>Maven plugin to run JUnit tests in parallel</description>

  <properties>
    <!--
        compare: http://docs.codehaus.org/display/MAVENUSER/POM+Element+for+Source+File+Encoding
    -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>2.7</version>
        <executions>
          <execution>
            <id>generated-helpmojo</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
      </plugin>      
    </plugins>
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-ssh</artifactId>
        <version>1.0-beta-6</version>
      </extension>
    </extensions>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>2.0</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-project</artifactId>
      <version>2.1.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant</artifactId>
      <version>1.7.1</version>
    </dependency>
    <dependency>
      <groupId>com.sun.istack</groupId>
      <artifactId>istack-commons-test</artifactId>
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>1.4</version>
    </dependency>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant-junit</artifactId>
      <version>1.7.1</version>
    </dependency>
    <dependency>
      <groupId>org.kohsuke</groupId>
      <artifactId>parallel-junit</artifactId>
      <version>1.1</version>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.main</groupId>
      <artifactId>remoting</artifactId>
      <version>1.406</version>
    </dependency>
    <dependency><!-- convenient to be able to see the whole Maven during debugging -->
      <groupId>org.apache.maven</groupId>
      <artifactId>apache-maven</artifactId>
      <version>2.2.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <id>m.g.o-public</id>
      <url>http://maven.glassfish.org/content/groups/public/</url>
    </repository>
  </repositories>

  <distributionManagement>
    <repository>
      <id>maven.hudson-labs.org</id>
      <url>http://maven.jenkins-ci.org:8081/content/repositories/releases</url>
    </repository>
    <site>
      <id>kohsuke.org</id>
      <url>scp://kohsuke.org/home/kohsuke/kohsuke.org/maven-junit-plugin/</url>
    </site>
  </distributionManagement>

  <scm>
    <url>http://github.com/kohsuke/maven-junit-plugin</url>
    <connection>scm:git:git://github.com/kohsuke/maven-junit-plugin.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/kohsuke/maven-junit-plugin.git</developerConnection>
  </scm>

  <reporting>
    <plugins>
      <plugin>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>2.7</version>
      </plugin>
    </plugins>
  </reporting>
  
  <profiles>
    <profile>
      <id>run-its</id>
      <activation>
        <property>
          <name>skipTests</name>
          <value>!true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>1.5</version>
            <configuration>
              <debug>true</debug>
              <projectsDirectory>src/it</projectsDirectory>
              <pomIncludes>
                <pomInclude>*/pom.xml</pomInclude>
              </pomIncludes>
              <postBuildHookScript>verify</postBuildHookScript>
              <localRepositoryPath>${project.build.directory}/local-it-repo</localRepositoryPath>
              <goals>
                <goal>clean</goal>
                <goal>test</goal>
              </goals>
              <settingsFile>src/it/settings.xml</settingsFile>
              <cloneProjectsTo>${project.build.directory}/it-tests</cloneProjectsTo>
            </configuration>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>install</goal>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>  
    
    <profile>
      <id>maven-3</id>
      <activation>
        <file>
          <!-- This employs that the basedir expression is only recognized by Maven 3.x (see MNG-2363) -->
          <exists>${basedir}</exists>
        </file>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-site-plugin</artifactId>
              <version>3.0-beta-3</version>
            </plugin>          
          </plugins>
        </pluginManagement>
      </build>
                  
    </profile>    
    
  </profiles>  
  
</project>
