<!--
 /*******************************************************************************
 * Copyright (c) 2017 Synopsys, Inc
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Synopsys, Inc - initial implementation and documentation
 *******************************************************************************/
-->
<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>2.13</version>
    </parent>

    <artifactId>coverity</artifactId>
    <version>1.9.2</version>
    <packaging>hpi</packaging>
    <name>Coverity plugin</name>
    <url>http://wiki.jenkins-ci.org/display/JENKINS/Coverity+Plugin</url>
    <licenses>
        <license>
            <name>Eclipse Public License</name>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>kdang</id>
            <name>Ken Dang</name>
            <email>kdang@coverity.com</email>
        </developer>
        <developer>
            <id>ahcho0819</id>
            <name>Andrew Cho</name>
            <email>acho@synopsys.com</email>
        </developer>
        <developer>
            <id>jbriggs</id>
            <name>Joel Briggs</name>
            <email>jbriggs@synopsys.com</email>
        </developer>
        <developer>
            <id>shami</id>
            <name>Shami Willms</name>
            <email>kwillms@synopsys.com</email>
        </developer>
    </developers>

    <repositories>
        <repository>
            <id>repo.jenkins-ci.org</id>
            <url>https://repo.jenkins-ci.org/public/</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>repo.jenkins-ci.org</id>
            <url>https://repo.jenkins-ci.org/public/</url>
        </pluginRepository>
    </pluginRepositories>

    <distributionManagement>
        <repository>
            <uniqueVersion>false</uniqueVersion>
            <id>maven.jenkins-ci.org</id>
            <url>https://repo.jenkins-ci.org/releases/</url>
        </repository>
        <snapshotRepository>
            <id>maven.jenkins-ci.org</id>
            <url>https://repo.jenkins-ci.org/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

    <scm>
        <connection>scm:git:ssh://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/jenkinsci/${project.artifactId}-plugin.git</developerConnection>
        <url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
      <tag>coverity-1.9.2</tag>
  </scm>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.2</version>
                <configuration>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>InjectedTest.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>none</phase>
                    </execution>
                </executions>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>jacoco</id>
            <activation>
                <property>
                    <name>ENABLE_JACOCO</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.7.9</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!--
                        Using JaCoCo through Ant due to limitations in jacoco-maven-plugin:
                        https://github.com/jacoco/jacoco/issues/271
                        https://github.com/jacoco/jacoco/issues/430
                        https://github.com/jacoco/jacoco/issues/493
                    -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>1.8</version>
                        <dependencies>
                            <dependency>
                                <groupId>org.jacoco</groupId>
                                <artifactId>org.jacoco.ant</artifactId>
                                <version>0.7.9</version>
                            </dependency>
                            <dependency>
                                <groupId>ant-contrib</groupId>
                                <artifactId>ant-contrib</artifactId>
                                <version>20020829</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>jacoco-report</id>
                                <phase>verify</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.build.directory}/jacoco.exec" property="jacoco.exec.file.exists" />
                                        <echo message="${project.build.directory}/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.build.directory}/jacoco.exec" />
                                                            </executiondata>
                                                            <structure name="Coverity">
                                                                <classfiles>
                                                                    <fileset dir="${project.build.outputDirectory}" />
                                                                    <fileset dir="${project.build.testOutputDirectory}" />
                                                                </classfiles>
                                                                <sourcefiles encoding="${project.build.sourceEncoding}">
                                                                    <fileset dir="${project.build.sourceDirectory}" />
                                                                    <fileset dir="${project.build.testSourceDirectory}" />
                                                                </sourcefiles>
                                                            </structure>
                                                            <html destdir="${project.reporting.outputDirectory}/jacoco" />
                                                            <xml destfile="${project.reporting.outputDirectory}/jacoco/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>
        <profile>
            <id>doclint-java8-disable</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <!-- XXX is this distinct from com.sun.xml.wss:xws-security:3.0 in Central? JARs are not identical. -->
            <groupId>com.sun.xml.xws</groupId>
            <artifactId>xws-security</artifactId>
            <version>3.0</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.messaging.saaj</groupId>
            <artifactId>saaj-impl</artifactId>
            <version>1.3.1</version>
        </dependency>
        <dependency>
            <groupId>javax.xml.soap</groupId>
            <artifactId>saaj-api</artifactId>
            <version>1.3</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.main</groupId>
            <artifactId>jenkins-war</artifactId>
            <version>${jenkins.version}</version>
            <type>war</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.main</groupId>
            <artifactId>jenkins-core</artifactId>
            <version>${jenkins.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-catalina</artifactId>
            <version>8.0.15</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <version>1.6.6</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito</artifactId>
            <version>1.6.6</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.10.19</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <properties>
        <jenkins.version>1.651.3</jenkins.version>
    </properties>
</project>

