<?xml version="1.0" encoding="UTF-8"?>
<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>

  <parent>
    <artifactId>jboss-parent</artifactId>
    <groupId>org.jboss</groupId>
    <version>19</version>
    <relativePath />
  </parent>

  <groupId>org.jboss.jbossset</groupId>
  <artifactId>bugclerk</artifactId>
  <version>0.8.2.Final</version>
  <packaging>jar</packaging>
  <name>Bug Clerk</name>
  <description>A inspection tool for bug/task entry, to check the quality of it and ensures it complies to defines rules and processes</description>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.8</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>

    <mockito.version>1.9.5</mockito.version>
    <org.wildfly.checkstyle-config.version>1.0.4.Final</org.wildfly.checkstyle-config.version>

    <version.drools>6.3.0.Final</version.drools>
    <version.org.drools>${version.drools}</version.org.drools>
    <version.org.kie>${version.drools}</version.org.kie>
  </properties>

  <scm>
    <connection>scm:git:github.com/jboss-set/bug-clerk</connection>
    <developerConnection>scm:git:git@github.com:jboss-set/bug-clerk</developerConnection>
    <url>https://github.com/jboss-set/pull-request-processor</url>
    <tag>bugclerk-0.8.2.Final</tag>
  </scm>

  <dependencies>
    <!-- Aphrodite - libs to all things trackery and repository -->
    <dependency>
      <groupId>org.jboss.set</groupId>
        <artifactId>aphrodite</artifactId>
          <version>0.4.0</version>
      </dependency>


    <!-- Drools -->
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-api</artifactId>
      <version>${version.org.drools}</version>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-core</artifactId>
      <version>${version.org.drools}</version>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-compiler</artifactId>
      <version>${version.org.drools}</version>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-decisiontables</artifactId>
      <version>${version.org.drools}</version>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-templates</artifactId>
      <version>${version.org.drools}</version>
    </dependency>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-internal</artifactId>
      <version>${version.org.drools}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>1.7.10</version>
      <scope>runtime</scope>
    </dependency>

    <!-- Others deps -->
    <dependency>
      <groupId>com.beust</groupId>
      <artifactId>jcommander</artifactId>
      <version>1.23</version>
    </dependency>

    <!-- Tests dependencies -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources/</directory>
      </resource>
      <resource>
        <directory>src/main/bash/</directory>
        <filtering>true</filtering>
        <excludes>
          <exclude>deploy-bugclerk.sh</exclude>
          <exclude>load-bugs.sh</exclude>
          <exclude>update-rules-on-readme.sh</exclude>
          <exclude>generate-changelog.sh</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <mainClass>org.jboss.jbossset.bugclerk.cli.BugClerkCLI</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.18.1</version>
        <configuration>
          <excludes>
            <exclude>org/jboss/jbossset/bugclerk/TestSuite.java</exclude>
          </excludes>
          <includes>
            <!-- Some internal tests -->
            <include>org/jboss/jbossset/bugclerk/utils/URLUtilsTest.java</include>
            <include>org/jboss/jbossset/bugclerk/ReportEngineTest.java</include>
            <include>org/jboss/jbossset/bugclerk/utils/StringUtilsTest.java</include>
            <include>org/jboss/jbossset/bugclerk/comments/CommentPatternMatcherTest.java</include>
            <!-- All tests based on checks -->
            <include>org/jboss/jbossset/bugclerk/checks/*.java</include>
            <!-- Integration tests - fired only if -Dbugclerk.run.cli.tests=true is passed to mvn -->
            <include>org/jboss/jbossset/bugclerk/cli/*.java</include>
          </includes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <createDependencyReducedPom>false</createDependencyReducedPom>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                  </excludes>
                </filter>
              </filters>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                  <manifestEntries>
                    <Main-Class>org.jboss.jbossset.bugclerk.cli.BugClerkWithFilterCLI</Main-Class>
                  </manifestEntries>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
            </plugin>
            <plugin>
              <groupId>org.jacoco</groupId>
              <artifactId>jacoco-maven-plugin</artifactId>
              <version>0.7.2.201409121644</version>
              <configuration>
                <excludes>
                  <!-- can't really unit test CLI behavior -->
                  <exclude>org/jboss/jbossset/bugclerk/cli/*.class</exclude>
                  <!-- same with logging function -->
                  <exclude>org/jboss/jbossset/bugclerk/utils/LoggingUtils.class</exclude>
                  <!-- bugzilla client layer is just a wrapper -->
                  <exclude>org/jboss/jbossset/bugclerk/bugzilla/BugzillaClient.class</exclude>
                  <!-- loaders are pointless to test without a proper backend -->
                  <exclude>org/jboss/jbossset/bugclerk/bugzilla/*Loader*.class</exclude>
                  <!-- not really worth covering -->
                  <exclude>org/jboss/jbossset/bugclerk/PerformanceMonitor.class</exclude>
                  <!-- testing POJO is really pointless -->
                  <exclude>org/jboss/jbossset/bugclerk/Candidate.class</exclude>
                  <exclude>org/jboss/jbossset/bugclerk/Violation.class</exclude>
                </excludes>
              </configuration>
              <executions>
                <execution>
                  <id>pre-unit-test</id>
                  <goals>
                    <goal>prepare-agent</goal>
                  </goals>
              </execution>
              <execution>
                <id>post-unit-test</id>
                <phase>test</phase>
                <goals>
                  <goal>report</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>2.14</version>
            <configuration>
              <argLine>${failsafe.argLine}</argLine>
            </configuration>
            <executions>
              <execution>
              <id>integration-test</id>
              <goals>
                <goal>integration-test</goal>
              </goals>
              </execution>
              <execution>
                <id>verify</id>
                <goals>
                  <goal>verify</goal>
                </goals>
             </execution>
          </executions>
        </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>3.5</version>
        <executions>
          <execution>
            <id>pmd-cpd</id>
            <phase>compile</phase>
            <goals>
              <goal>pmd</goal>
              <goal>cpd</goal>
            </goals>
            <configuration>
              <linkXref>true</linkXref>²
              <sourceEncoding>utf-8</sourceEncoding>
              <rulesets>
                <ruleset>/src/main/resources/pmd.xml</ruleset>
              </rulesets>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.10.3</version>
        <executions>
          <execution>
            <id>javadoc</id>
            <phase>compile</phase>
            <goals>
              <goal>javadoc</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <configuration>
            <configLocation>wildfly-checkstyle/checkstyle.xml</configLocation>
            <consoleOutput>true</consoleOutput>
            <failsOnError>true</failsOnError>
            <useFile />
            <linkXRef>false</linkXRef>
          </configuration>
          <dependencies>
            <dependency>
            <groupId>org.wildfly.checkstyle</groupId>
            <artifactId>wildfly-checkstyle-config</artifactId>
            <version>${org.wildfly.checkstyle-config.version}</version>
            </dependency>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>${version.checkstyle}</version>
              <exclusions>
                <exclusion>
                  <groupId>com.sun</groupId>
                  <artifactId>tools</artifactId>
                </exclusion>
              </exclusions>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <id>check-style</id>
              <phase>compile</phase>
              <goals>
                <goal>checkstyle</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <linkJavadoc>true</linkJavadoc>
          <javadocDir>${project.build.directory}/site/apidocs</javadocDir>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>3.5</version>
      </plugin>
    </plugins>
  </reporting>

  <repositories>
    <repository>
      <id>jboss-public-repository-group</id>
      <name>JBoss Public Maven Repository Group</name>
      <url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
      <layout>default</layout>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>never</updatePolicy>
      </releases>
      <snapshots>
        <enabled>true</enabled>
        <updatePolicy>never</updatePolicy>
      </snapshots>
    </repository>
  </repositories>

</project>

