<?xml version="1.0" encoding="UTF-8"?>
<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>org.codehaus.sonar-plugins</groupId>
    <artifactId>parent</artifactId>
    <version>9</version>
    <relativePath>../parent</relativePath>
  </parent>

  <artifactId>sonar-jacoco-plugin</artifactId>
  <version>0.6</version>
  <packaging>sonar-plugin</packaging>

  <name>Sonar JaCoCo Plugin</name>
  <description>JaCoCo is an alternative to Clover and Cobertura to measure coverage by unit tests.</description>
  <url>http://docs.codehaus.org/display/SONAR/JaCoCo+Plugin</url>
  <inceptionYear>2010</inceptionYear>
  <organization>
    <name>SonarSource</name>
    <url>http://www.sonarsource.com</url>
  </organization>
  <licenses>
    <license>
      <name>GNU LGPL 3</name>
      <url>http://www.gnu.org/licenses/lgpl.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>godin</id>
      <name>Evgeny Mandrikov</name>
    </developer>
  </developers>

  <scm>
    <connection>scm:svn:http://svn.codehaus.org/sonar-plugins/tags/sonar-jacoco-plugin-0.6</connection>
    <developerConnection>scm:svn:https://svn.codehaus.org/sonar-plugins/tags/sonar-jacoco-plugin-0.6</developerConnection>
    <url>scm:svn:https://svn.codehaus.org/sonar-plugins/tags/sonar-jacoco-plugin-0.6</url>
  </scm>
  <issueManagement>
    <system>JIRA</system>
    <url>http://jira.codehaus.org/browse/SONARPLUGINS/component/14417</url>
  </issueManagement>
  <ciManagement>
    <system>Bamboo</system>
    <url>http://ci.codehaus.org/browse/SONAR-JACOCO</url>
  </ciManagement>

  <properties>
    <jacoco.version>0.5.2.20110519202509</jacoco.version>

    <sonar.version>2.7</sonar.version>
    <sonar.pluginName>JaCoCo</sonar.pluginName>
    <sonar.pluginClass>org.sonar.plugins.jacoco.JaCoCoPlugin</sonar.pluginClass>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.jacoco</groupId>
      <artifactId>org.jacoco.core</artifactId>
      <version>${jacoco.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jacoco</groupId>
      <artifactId>org.jacoco.agent</artifactId>
      <version>${jacoco.version}</version>
    </dependency>
    <!-- Next two dependencies should be provided transitively from org.jacoco.core - see SONARPLUGINS-897 -->
    <dependency>
      <groupId>asm</groupId>
      <artifactId>asm</artifactId>
      <version>3.2</version>
    </dependency>
    <dependency>
      <groupId>asm</groupId>
      <artifactId>asm-commons</artifactId>
      <version>3.2</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.sonar</groupId>
      <artifactId>sonar-plugin-api</artifactId>
      <version>${sonar.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.sonar</groupId>
      <artifactId>sonar-gwt-api</artifactId>
      <version>${sonar.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.sonar</groupId>
      <artifactId>sonar-ws-client</artifactId>
      <version>${sonar.version}</version>
    </dependency>
    <!-- Would be provided by environment -->
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant</artifactId>
      <version>1.7.0</version>
      <scope>provided</scope>
    </dependency>
    <!-- unit tests -->
    <dependency>
      <groupId>org.codehaus.sonar</groupId>
      <artifactId>sonar-testing-harness</artifactId>
      <version>${sonar.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-project</artifactId>
      <version>2.0.7</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-httpclient</groupId>
      <artifactId>commons-httpclient</artifactId>
      <version>3.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <executions>
          <execution>
            <configuration>
              <modules>
                <module>org.sonar.plugins.jacoco.itcoverage.viewer.CoverageViewer</module>
              </modules>
              <skip>${skipGwt}</skip>
              <webappDirectory>${project.build.directory}/classes</webappDirectory>

              <!-- do not break on two lines -->
              <extraJvmArgs>-Xmx512m -Dgwt.jjs.permutationWorkerFactory=com.google.gwt.dev.ThreadedPermutationWorkerFactory</extraJvmArgs>
            </configuration>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>integration-tests</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>unpack</id>
                <phase>package</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.codehaus.sonar.plugins.it</groupId>
                      <artifactId>struts</artifactId>
                      <version>1.3.9</version>
                      <type>zip</type>
                    </artifactItem>
                  </artifactItems>
                  <outputDirectory>${project.build.directory}/it/maven-projects</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.sonar</groupId>
            <artifactId>sonar-dev-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>start-server</id>
                <phase>pre-integration-test</phase>
                <configuration>
                  <background>true</background>
                  <clean>true</clean>
                  <configBackup>${basedir}/src/it/sonar-backup.xml</configBackup>
                </configuration>
                <goals>
                  <goal>start-war</goal>
                </goals>
              </execution>
              <execution>
                <id>analyze-projects</id>
                <phase>pre-integration-test</phase>
                <configuration>
                  <projectsDir>${project.build.directory}/it/maven-projects</projectsDir>
                </configuration>
                <goals>
                  <goal>analyze</goal>
                </goals>
              </execution>
              <execution>
                <id>stop-server</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>stop-war</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <repositories>
        <repository>
          <id>sonarsource-releases</id>
          <name>SonarSource releases</name>
          <url>http://repository.sonarsource.org/content/repositories/sonar/</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
      </repositories>
    </profile>
  </profiles>

  <repositories>
    <repository>
      <!-- for jacoco -->
      <id>sonar</id>
      <name>Sonar</name>
      <url>http://repository.sonarsource.org/content/repositories/sonar</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>
</project>
