how to configure Jenkins Cobertura not to give instrumented package?

220 views Asked by At

Jenkins along with Cobertura using Maven deploying instrumented jar file to my repository. I don't want an instrumented jar in my application. So anybody know how to handle this in jenkins/Cobertura/Maven?

I found that if in Jenkins I change the order to 'clean site install' instead of 'clean install site' it is giving noninstrumented code.

I am using Jenkins 1.548 along with java1.8

This is my POM.xml

<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>com.premierinc.its</groupId>
<artifactId>populationGrouper</artifactId>
<version>15.2.2.0-SNAPSHOT</version>

<packaging>jar</packaging>

<name>PopulationGrouper</name>
<description>
    Premier Population Grouper Service API.
</description>

<scm>
    <connection>scm:git:ssh://git@code/pfpg/population_grouper.git</connection>
    <developerConnection>scm:git:ssh://git@code/pfgp/population_grouper.git</developerConnection>
    <tag>HEAD</tag>
</scm>

<distributionManagement>
    <repository>
        <id>code-artifacts</id>
        <url>
            http://code/artifacts/content/repositories/releases
        </url>
    </repository>
    <snapshotRepository>
        <id>code-artifacts</id>
        <url>
            http://code/artifacts/content/repositories/snapshots
        </url>
    </snapshotRepository>
</distributionManagement>

<properties>
    <spring.version>4.0.3.RELEASE</spring.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <oracle.version>11.2.0.2.0</oracle.version>
</properties>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.15</version>
            <configuration>
                <argLine>-Xms512m -Xmx512m</argLine>
            </configuration>
        </plugin>

        <!-- <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
            <version>2.7</version>
            <configuration>
                <formats>
                    <format>xml</format>
                    <format>html</format>
                </formats>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>cobertura</goal>
                    </goals>
                </execution>
            </executions>
        </plugin> -->

        <plugin>
            <groupId>com.atlassian.maven.plugins</groupId>
            <artifactId>maven-jgitflow-plugin</artifactId>
            <version>1.0-alpha21.1</version>
            <configuration>
                <autoVersionSubmodules>true</autoVersionSubmodules>
                <pushFeatures>true</pushFeatures>
                <pushHotfixes>true</pushHotfixes>
                <pushReleases>true</pushReleases>
                <noReleaseBuild>true</noReleaseBuild>
                <noFeatureBuild>true</noFeatureBuild>
                <noHotfixBuild>true</noHotfixBuild>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxb2-maven-plugin</artifactId>
            <version>1.3</version>

            <executions>
                <execution>
                    <id>myFile</id>
                    <goals>
                        <goal>xjc</goal>
                    </goals>
                    <configuration>
                        <schemaDirectory>src/main/resources/schema</schemaDirectory>
                        <outputDirectory>src/main/java/</outputDirectory>
                        <extension>true</extension>
                        <arguments>
                            -no-header -cp collection-setter-injector.jar
                            -Xcollection-setter-injector
                        </arguments>
                        <packageName>com.premierinc.its.pfgpgrouper.dto</packageName>
                        <staleFile>
                            ${project.build.directory}/generated-sources/jaxb/patient/.staleFlag
                        </staleFile>

                        <clearOutputDir>false</clearOutputDir>
                    </configuration>
                </execution>

            </executions>
            <dependencies>
                <dependency>
                    <groupId>net.java.dev.vcc.thirdparty</groupId>
                    <artifactId>collection-setter-injector</artifactId>
                    <version>0.5.0-1</version>
                </dependency>
            </dependencies>

        </plugin>

    </plugins>

    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
        </resource>
    </resources>

</build>


<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>2.7</version>
        </plugin>
        <!-- <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.10.1</version>
        </plugin> -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jxr-plugin</artifactId>
            <version>2.4</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>2.17</version>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
            <version>3.0.0</version>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
            <version>2.7</version>
            <configuration>
                <formats>
                    <format>html</format>
                    <format>xml</format>
                </formats>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pmd-plugin</artifactId>
            <version>3.2</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <version>2.13</version>
            <configuration>
                <configLocation>src/code-analysis/checkstyle.xml</configLocation>
            </configuration>
        </plugin>
    </plugins>
</reporting>






<dependencies>
    <!-- DB Driver -->
    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc6g</artifactId>
        <version>${oracle.version}</version>
    </dependency>

    <!-- SPRING -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${spring.version}</version>
        <exclusions>
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-mock</artifactId>
        <version>2.0.8</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-oxm</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>${spring.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>5.14.2</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.2.1</version>
    </dependency>
    <dependency>
        <groupId>axis</groupId>
        <artifactId>axis</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>1.10.19</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.10</version>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.1.2</version>
    </dependency>

</dependencies>

0

There are 0 answers