<!--
  ~ Copyright (C) 2012 White Source Ltd.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the Licens
  -->

<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.8</version>
    </parent>

    <artifactId>whitesource</artifactId>
    <version>18.9.1</version>
    <packaging>hpi</packaging>

    <name>White Source Jenkins plugin</name>
    <description>White Source external update agent for Jenkins CI</description>
    <url>https://wiki.jenkins-ci.org/display/JENKINS/Whitesource+Plugin/</url>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <scm>
        <connection>scm:git:git://github.com/jenkinsci/whitesource-plugin.git</connection>
        <developerConnection>scm:git:https://github.com/jenkinsci/whitesource-plugin.git</developerConnection>
        <url>http://github.com/jenkinsci/whitesource-plugin</url>
        <tag>release-tag-18.9.1</tag>
    </scm>
    <organization>
        <name>White Source</name>
        <url>http://www.whitesourcesoftware.com/</url>
    </organization>
    <developers>
        <developer>
            <id>annarozin</id>
            <name>Anna Rozin</name>
            <email>anna.rozin@whitesourcesoftware.com</email>
            <organization>White Source</organization>
            <url>http://www.whitesourcesoftware.com/</url>
            <roles>
                <role>Lead Developer</role>
            </roles>
        </developer>
        <developer>
            <id>ArtiomPetrov</id>
            <name>Artiom Petrov</name>
            <email>artiom.petrov@whitesourcesoftware.com</email>
            <organization>White Source</organization>
            <url>http://www.whitesourcesoftware.com/</url>
            <roles>
                <role>Software Developer</role>
            </roles>
        </developer>
        <developer>
            <id>sramakrishna</id>
            <name>Ramakrishna Sharvirala</name>
            <email>ramakrishna.sharvirala@gmail.com</email>
        </developer>
    </developers>

    <properties>
        <!-- Minimal Jenkins version (2.14.0 ) required by for pipeline job -->
        <jenkins.version>1.642.3</jenkins.version>
        <!--<jenkins.version>2.14</jenkins.version>-->
        <!--<jenkins.version>2.60.3</jenkins.version>-->
        <slf4j.version>1.7.5</slf4j.version>
        <java.level>8</java.level>
        <agent.version>2.7.6</agent.version>
        <skipTests>true</skipTests>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <!-- https://mvnrepository.com/artifact/org.jenkins-ci.plugins.workflow/workflow-aggregator -->
        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-job</artifactId>
            <version>2.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.jenkins-ci.plugins.workflow/workflow-step-api -->
        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-cps</artifactId>
            <version>2.0</version>
        </dependency>

        <dependency>
            <groupId>org.whitesource</groupId>
            <artifactId>whitesource-fs-agent</artifactId>
            <version>18.6.3</version>
            <!-- Add again after the fsa will be update -->
            <exclusions>
                <exclusion>
                    <groupId>org.whitesource.analysis</groupId>
                    <artifactId>whitesource-analysis-via</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.whitesource</groupId>
                    <artifactId>wss-agent-via-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>ch.qos.logback</groupId>
                    <artifactId>logback-classic</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.jenkins-ci.main</groupId>
            <artifactId>maven-plugin</artifactId>
            <version>2.17</version>
        </dependency>
        <dependency>

            <groupId>org.jenkinsci.plugins</groupId>
            <artifactId>git</artifactId>
            <version>1.1.14</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
            <version>4.4</version>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-step-api</artifactId>
            <version>2.9</version>
        </dependency>

        <!-- Logging -->

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.2.3</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.jenkins-ci.tools</groupId>
                <artifactId>maven-hpi-plugin</artifactId>
                <version>1.112</version>
                <executions>
                    <execution>
                        <configuration>
                            <pluginFirstClassLoader>true</pluginFirstClassLoader>
                            <rules>
                                <bannedDependencies>
                                    <excludes>
                                        <!-- remove banned dependencies -->
                                        <exclude>org.slf4j:slf4j-jdk14:*:jar:compile</exclude>
                                    </excludes>
                                </bannedDependencies>
                            </rules>
                            <fail>true</fail>
                        </configuration>

                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
            </plugin>

        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.whitesource</groupId>
                    <artifactId>whitesource-maven-plugin</artifactId>
                    <version>1.1.6</version>
                    <configuration>
                        <orgToken>${whitesource.orgToken}</orgToken>
                        <checkPolicies>true</checkPolicies>
                    </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.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <version>3.0.5</version>
                    <configuration>
                        <xmlOutput>true</xmlOutput>
                        <!-- Optional directory to put findbugs xdoc xml report -->
                        <xmlOutputDirectory>target/site</xmlOutputDirectory>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>Release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.github</groupId>
                        <artifactId>site-maven-plugin</artifactId>
                        <version>0.8</version>
                        <configuration>
                            <server>github</server>
                            <merge>true</merge>
                            <force>true</force>
                            <message>Building site for ${project.artifactId} - ${project.version}</message>
                            <excludes>
                                <exclude>assembly</exclude>
                            </excludes>
                        </configuration>
                        <executions>
                            <execution>
                                <id>github-pages</id>
                                <phase>site</phase>
                                <goals>
                                    <goal>site</goal>
                                </goals>
                            </execution>
                        </executions>
                    </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.codehaus.mojo</groupId>
                        <artifactId>findbugs-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>findbugs</id>
                                <configuration>

                                    <!--<excludeFilterFile>${project.basedir}/src/findbugs/excludesFilter.xml</excludeFilterFile>-->
                                    <classFilesDirectory>${project.basedir}/test</classFilesDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <!-- get every artifact through repo.jenkins-ci.org, which proxies all the
         artifacts that we need -->
    <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>
</project>
