Hallo ,

by integrating cobertura instrumented file into the warefle using maven and
follwong
http://mojo.codehaus.org/cobertura-maven-plugin/instrumentingDeploymentArtifact.html

- I do not get more than a target witt compiled and isntrumented classes.
But the war-file does not have the instrumented class. I yust contains the
compiler uninstumented class.

Who can help?

Structure:

Parentdir
      |
      | ------ pom.xml
      |
      |  -------  prjWar
                      |
                      | -------------- pom.xml
                      | -------------- src, main, etc.
       | --------- prj4Cobertura (cobertura focused prj)
                    |
                    | -------------- pom.xml
                    | --------------  no src,  etc.


Thank you in advance!

Michael Averstegge
Dipl.-Inform.
Phone: +49(0)157 31448443
<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>

  <groupId>de.leo.mavenlearn</groupId>
  <artifactId>prjWarParent</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>pom</packaging>

  <name>prjWarParent</name>
  <modules>
    <module>prjWar</module>
  </modules>

  <properties>
    <!-- cobertura -->
    <cobertura.version>1.9.2</cobertura.version>
  </properties>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>cobertura-maven-plugin</artifactId>
          <version>2.4</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>cobertura-instrument</id>
      <activation>
        <property>
          <name>cobertura-build</name>
        </property>
      </activation>
      <modules>
        <module>prj4Cobertura</module>
      </modules>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
            <configuration>
            </configuration>
            <executions>
              <execution>
                <id>instrument-code</id>
                <phase>process-classes</phase>
                <goals>
                  <goal>instrument</goal>
                </goals>
                <configuration>
                  <attach>true</attach>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
            <inherited>true</inherited>
          </plugin>
        </plugins>
      </build>
      <dependencies>
        <dependency>
          <groupId>net.sourceforge.cobertura</groupId>
          <artifactId>cobertura-runtime</artifactId>
          <version>${cobertura.version}</version>
          <scope>compile</scope>
          <type>pom</type>
        </dependency>
      </dependencies>
    </profile>
  </profiles>

</project>
<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";>

  <parent>
    <groupId>de.leo.mavenlearn</groupId>
    <artifactId>prjWarParent</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>

  <!-- groupId>de.leo.mavenlearn</groupId -->
  <artifactId>prjWar</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>war</packaging>
  <name>prjWar</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <version.org.jboss.as.plugins.maven.plugin>7.5.Final</version.org.jboss.as.plugins.maven.plugin>
    <version.org.jboss.spec.jboss.javaee.6.0>3.0.2.Final</version.org.jboss.spec.jboss.javaee.6.0>
    <version.junit>4.4</version.junit>

    <!-- other plugin versions -->
    <version.compiler.plugin>2.3.1</version.compiler.plugin>
    <version.war.plugin>2.1.1</version.war.plugin>

    <!-- maven-compiler-plugin -->
    <maven.compiler.target>1.6</maven.compiler.target>
    <maven.compiler.source>1.6</maven.compiler.source>
  </properties>

  <repositories>
    <repository>
      <id>jboss-repo</id>
      <name>jboss-repo</name>
      <url>https://repository.jboss.org/nexus/content/repositories/thirdparty-releases</url>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>org.jboss.spec</groupId>
      <artifactId>jboss-javaee-6.0</artifactId>
      <version>${version.org.jboss.spec.jboss.javaee.6.0}</version>
      <type>pom</type>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.0.1</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>net.sourceforge.jwebunit</groupId>
      <artifactId>jwebunit-htmlunit-plugin</artifactId>
      <version>3.1</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${version.junit}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.xalan</groupId>
      <artifactId>xalan</artifactId>
      <version>2.7.1-1.jbossorg</version>
    </dependency>

  </dependencies>


  <build>
    <finalName>erstewar</finalName>
    <plugins>

      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>${version.war.plugin}</version>
        <configuration>
          <!-- Java EE 6 doesn't require web.xml, Maven needs to catch up! -->
          <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
      </plugin>
      <!-- JBoss AS plugin to deploy war -->
      <plugin>
        <groupId>org.jboss.as.plugins</groupId>
        <artifactId>jboss-as-maven-plugin</artifactId>
        <version>${version.org.jboss.as.plugins.maven.plugin}</version>
      </plugin>
      <!-- Compiler plugin enforces Java 1.6 compatibility and activates annotation processors -->
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${version.compiler.plugin}</version>
        <configuration>
          <source>${maven.compiler.source}</source>
          <target>${maven.compiler.target}</target>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <reporting>
    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>2.16</version>
      </plugin>
    </plugins>
  </reporting>

</project>
<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";>

  <parent>
    <groupId>de.leo.mavenlearn</groupId>
    <artifactId>prjWarParent</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>

  <!-- groupId>de.leo.mavenlearn</groupId -->
  <artifactId>prj4Cobertura</artifactId>
  <name>prj4Cobertura</name>
  <packaging>pom</packaging>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptors>
            <descriptor>${basedir}/src/main/assembly/coberturaReporting.xml</descriptor>
          </descriptors>
          <attach>true</attach>
        </configuration>
        <executions>
          <execution>
            <id>bundle-configs</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>net.sourceforge.cobertura</groupId>
      <artifactId>cobertura</artifactId>
      <!--cobertura.version is inherited from the parent POM -->
      <version>${cobertura.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>prjWar</artifactId>
      <version>${project.version}</version>
      <classifier>sources</classifier>
      <type>war</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>prjWar</artifactId>
      <version>${project.version}</version>
      <classifier>cobertura</classifier>
      <type>ser</type>
      <scope>compile</scope>
    </dependency>
  </dependencies>
</project>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to