<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.jenkins-ci.plugins</groupId>
      <artifactId>plugin</artifactId>
      <version>1.424.6</version>
      <relativePath />
   </parent>

   <artifactId>jacoco</artifactId>
   <version>1.0.11</version>
   <packaging>hpi</packaging>

   <name>Jenkins JaCoCo plugin</name>
   <url>https://wiki.jenkins-ci.org/display/JENKINS/JaCoCo+Plugin</url>

   
   <developers>
      <developer>
         <id>kohsuke</id>
         <name>Kohsuke Kawaguchi</name>
      </developer>
      <developer>
         <id>stephenconnolly</id>
         <name>Stephen Connolly</name>
      </developer>
      <developer>
         <id>manolo</id>
         <name>Manuel Carrasco Monino</name>
         <email>manolo@apache.org</email>
      </developer>
      <developer>
         <id>jfuerth</id>
         <name>Jonathan Fuerth</name>
      </developer>
      <developer>
         <id>kingargyle</id>
         <name>David Carver</name>
      </developer>
      <developer>
         <id>ognjenb</id>
         <name>Ognjen Bubalo</name>
      </developer>
   </developers>

   <scm>
      <connection>scm:git:ssh://github.com/jenkinsci/jacoco-plugin.git</connection>
      <developerConnection>scm:git:ssh://git@github.com/jenkinsci/jacoco-plugin.git</developerConnection>
	  <url>https://github.com/jenkinsci/jacoco-plugin</url>
   </scm>

   <properties>
      <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
      <project.build.outputEncoding>UTF-8</project.build.outputEncoding>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>

   <repositories>
      <repository>
         <id>repo.jenkins-ci.org</id>
         <url>http://repo.jenkins-ci.org/public/</url>
      </repository>
   </repositories>

   <pluginRepositories>
      <pluginRepository>
         <id>jacoco-snapshot-repository</id>
         <name>JaCoCo Snapshot Build Repository</name>
         <url>https://oss.sonatype.org/content/repositories/snapshots</url>
         <layout>default</layout>
      </pluginRepository>
      <pluginRepository>
         <id>repo.jenkins-ci.org</id>
         <url>http://repo.jenkins-ci.org/public/</url>
      </pluginRepository>
   </pluginRepositories>

   <dependencies>
      <dependency>
         <groupId>org.jenkins-ci.plugins</groupId>
         <artifactId>dashboard-view</artifactId>
         <version>2.1</version>
         <optional>true</optional>
      </dependency>
      <dependency>
	    <groupId>org.jacoco</groupId>
	    <artifactId>org.jacoco.report</artifactId> <!-- we're done with ReportMojo now, so we don't need to depend on the maven plugin anymore -->
	    <version>0.6.1.201212231917</version>
	  </dependency>
      <dependency>
			<groupId>org.kohsuke</groupId>
			<artifactId>asm4</artifactId>
			<version>4.0</version>
			<scope>runtime</scope>
	  </dependency>
	  <dependency>
			<groupId>org.ow2.asm</groupId>
			<artifactId>asm</artifactId>
			<version>4.1</version>
			<scope>runtime</scope>
	  </dependency>
	  <dependency>
			<groupId>org.ow2.asm</groupId>
			<artifactId>asm-commons</artifactId>
			<version>4.1</version>
			<scope>runtime</scope>
	  </dependency>
	<dependency>
		<groupId>org.easymock</groupId>
		<artifactId>easymockclassextension</artifactId>
		<version>2.2</version>
	</dependency>
	<dependency>
		<groupId>org.jacoco</groupId>
		<artifactId>jacoco-maven-plugin</artifactId>
		<version>0.6.1.201212231917</version>
	</dependency>
   </dependencies>
   
	<distributionManagement>
		<repository>
		  <id>maven.jenkins-ci.org</id>
		  <url>http://maven.jenkins-ci.org:8081/content/repositories/releases/</url>
		</repository>
	 </distributionManagement>

   <build>
      <plugins>
		 <plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-shade-plugin</artifactId>
			<version>1.3.1</version>
			<executions>
			  <execution>
				<phase>insert-test</phase>
				<goals>
				  <goal>shade</goal>
				</goals>
				<configuration>
				  <relocations>
					<relocation>
					  <pattern>org.objectweb.asm</pattern>
					  <shadedPattern>org.kohsuke.asm3</shadedPattern>
					</relocation>
				  </relocations>
				</configuration>
			  </execution>
			</executions>
		 </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
               <source>1.5</source>
               <target>1.5</target>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>animal-sniffer-maven-plugin</artifactId>
            <version>1.9</version>
            <configuration>
                <signature>
                  <groupId>org.codehaus.mojo.signature</groupId>
                  <artifactId>java15</artifactId>
                  <version>1.0</version>
                </signature>
            </configuration>
            <executions>
            	<execution>
            		<phase>test</phase>
            		<goals>
            			<goal>check</goal>
            		</goals>
            	</execution>
            </executions>
        </plugin>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>

               <!-- Attention Eclipse users: if you see an error here, you 
                  have to install the M2E buildhelper plugin. -->
               <execution>
                  <id>add-localizer-source-folder</id>
                  <phase>generate-sources</phase>
                  <goals>
                     <goal>add-source</goal>
                  </goals>
                  <configuration>
                     <sources>
                        <source>${project.build.directory}/generated-sources/localizer</source>
                     </sources>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.5.6.201201232323</version>
            <executions>
               <execution>
                  <id>jacoco-initialize</id>
                  <phase>initialize</phase>
                  <goals>
                     <goal>prepare-agent</goal>
                  </goals>
               </execution>
               <execution>
                  <id>jacoco-site</id>
                  <phase>site</phase>
                  <goals>
                     <goal>report</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
		 <plugin>
			  <groupId>org.jenkins-ci.tools</groupId>
			  <artifactId>
				 maven-hpi-plugin
			  </artifactId>
			  <executions>
				 <execution>
				   <phase>compile</phase>
				   <goals>
					 <goal>hpi</goal>
				   </goals>
				 </execution>
			   </executions>
			
			  <configuration>
				<pluginFirstClassLoader>true</pluginFirstClassLoader>
				<maskClasses>org.objectweb.asm.</maskClasses>
			  </configuration>
		</plugin>
	  </plugins>
      <pluginManagement>
         <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e 
               settings only. It has no influence on the Maven build itself. -->
            <plugin>
               <groupId>org.eclipse.m2e</groupId>
               <artifactId>lifecycle-mapping</artifactId>
               <version>1.0.0</version>
               <configuration>
                  <lifecycleMappingMetadata>
                     <pluginExecutions>
                        <pluginExecution>
                           <pluginExecutionFilter>
                              <groupId>org.jenkins-ci.tools</groupId>
                              <artifactId>
                                 maven-hpi-plugin
                              </artifactId>
                              <versionRange>[1.64,)</versionRange>
                              <goals>
                                 <goal>apt-compile</goal>
                                 <goal>insert-test</goal>
                                 <goal>
                                    resolve-test-dependencies
                                 </goal>
                                 <goal>test-hpl</goal>
                                 <goal>validate</goal>
                              </goals>
							  <configuration>
								<pluginFirstClassLoader>true</pluginFirstClassLoader>
							  
							  </configuration>
							  
							  
                           </pluginExecutionFilter>
                           <action>
                              <ignore />
                           </action>
                        </pluginExecution>
                        <pluginExecution>
                           <pluginExecutionFilter>
                              <groupId>
                                 org.apache.maven.plugins
                              </groupId>
                              <artifactId>
                                 maven-enforcer-plugin
                              </artifactId>
                              <versionRange>[1.0,)</versionRange>
                              <goals>
                                 <goal>display-info</goal>
                              </goals>
                           </pluginExecutionFilter>
                           <action>
                              <ignore />
                           </action>
                        </pluginExecution>
                        <pluginExecution>
                           <pluginExecutionFilter>
                              <groupId>
                                 org.codehaus.groovy.maven
                              </groupId>
                              <artifactId>gmaven-plugin</artifactId>
                              <versionRange>[1.0-rc-5,)</versionRange>
                              <goals>
                                 <goal>generateTestStubs</goal>
                                 <goal>testCompile</goal>
                              </goals>
                           </pluginExecutionFilter>
                           <action>
                              <ignore />
                           </action>
                        </pluginExecution>
                        <pluginExecution>
                           <pluginExecutionFilter>
                              <groupId>org.jvnet.localizer</groupId>
                              <artifactId>
                                 maven-localizer-plugin
                              </artifactId>
                              <versionRange>[1.8,)</versionRange>
                              <goals>
                                 <goal>generate</goal>
                              </goals>
                           </pluginExecutionFilter>
                           <action>
                              <execute />
                           </action>
                        </pluginExecution>
                        <pluginExecution>
                           <pluginExecutionFilter>
                              <groupId>org.kohsuke</groupId>
                              <artifactId>
                                 access-modifier-checker
                              </artifactId>
                              <versionRange>[1.0,)</versionRange>
                              <goals>
                                 <goal>enforce</goal>
                              </goals>
                           </pluginExecutionFilter>
                           <action>
                              <ignore />
                           </action>
                        </pluginExecution>
                        <pluginExecution>
                           <pluginExecutionFilter>
                              <groupId>org.jacoco</groupId>
                              <artifactId>jacoco-maven-plugin</artifactId>
                              <versionRange>[0.5.6.201201232323,)</versionRange>
                              <goals>
                                 <goal>prepare-agent</goal>
                              </goals>
                           </pluginExecutionFilter>
                           <action>
                              <ignore />
                           </action>
                        </pluginExecution>
                        <pluginExecution>
                           <pluginExecutionFilter>
                              <groupId>org.codehaus.gmaven</groupId>
                              <artifactId>gmaven-plugin</artifactId>
                              <versionRange>[1.3,)</versionRange>
                              <goals>
                                 <goal>generateTestStubs</goal>
                                 <goal>testCompile</goal>
                              </goals>
                           </pluginExecutionFilter>
                           <action>
                              <ignore />
                           </action>
                        </pluginExecution>
                        <pluginExecution>
                           <pluginExecutionFilter>
                              <groupId>com.cloudbees</groupId>
                              <artifactId>maven-license-plugin</artifactId>
                              <versionRange>[1.4,)</versionRange>
                              <goals>
                                 <goal>process</goal>
                              </goals>
                           </pluginExecutionFilter>
                           <action>
                              <ignore />
                           </action>
                        </pluginExecution>
                     </pluginExecutions>
                  </lifecycleMappingMetadata>
               </configuration>
            </plugin>
         </plugins>
      </pluginManagement>
   </build>
	<profiles>
		<profile>
			<id>coverage</id>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.jacoco</groupId>
                  <artifactId>jacoco-maven-plugin</artifactId>
                  <version>0.5.6.201201232323</version>
                  <executions>
                     <execution>
                        <goals>
                           <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                           <includes>
                              <include>hudson.plugins.jacoco.*</include>
                           </includes>
                        </configuration>
                     </execution>
                  </executions>
               </plugin>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-antrun-plugin</artifactId>
                  <version>1.7</version>
                  <dependencies>
                     <dependency>
                        <groupId>org.jacoco</groupId>
                        <artifactId>org.jacoco.ant</artifactId>
                        <version>0.5.6.201201232323</version>
                     </dependency>
                     <dependency>
                        <groupId>ant-contrib</groupId>
                        <artifactId>ant-contrib</artifactId>
                        <version>20020829</version>
                     </dependency>
                  </dependencies>
                  <executions>
                     <execution>
                        <id>jacoco-report</id>
                        <phase>install</phase>
                        <goals>
                           <goal>run</goal>
                        </goals>
                        <configuration>
                           <target>
                              <taskdef name="jacoco-report" classname="org.jacoco.ant.ReportTask" classpathref="maven.plugin.classpath" />
                              <taskdef classpathref="maven.runtime.classpath" resource="net/sf/antcontrib/antcontrib.properties" />
                              <available file="${project.basedir}/target/jacoco.exec" property="jacoco.exec.file.exists" />
                              <echo message="${project.basedir}/target/jacoco.exec" />
                              <if>
                                 <equals arg1="${jacoco.exec.file.exists}" arg2="true" />
                                 <then>
                                    <echo message="Executing jacoco report" />
                                    <trycatch>
                                       <try>
                                          <jacoco-report>
                                             <executiondata>
                                                <file file="${project.basedir}/target/jacoco.exec" />
                                             </executiondata>

                                             <structure name="Minerva">
                                                <classfiles>
                                                   <fileset dir="${project.basedir}/target/classes" />
                                                </classfiles>
                                                <sourcefiles encoding="UTF-8">
                                                   <fileset dir="${project.basedir}/src/main/java" />
                                                </sourcefiles>
                                             </structure>

                                             <html destdir="${project.basedir}/target/jacoco/report" />
                                             <xml destfile="${project.basedir}/target/jacoco/report/jacoco.xml" />
                                          </jacoco-report>
                                       </try>
                                       <catch>
                                          <echo>skipping</echo>
                                       </catch>
                                    </trycatch>
                                 </then>
                                 <else>
                                    <echo message="No jacoco.exec file found." />
                                 </else>
                              </if>
                           </target>
                        </configuration>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>
		</profile>
	</profiles>


</project>
