<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>org.openhab.tools.sat</groupId>
  <artifactId>pom</artifactId>
  <version>0.7.0</version>
  <packaging>pom</packaging>

  <name>Static Code Analysis Tool Parent Pom</name>
  <description>Tool that aggregates reports of PMD, Checkstyle and FindBugs</description>
  <url>https://github.com/openhab/static-code-analysis</url>

  <licenses>
    <license>
      <name>Eclipse Public License 2.0</name>
      <url>https://www.eclipse.org/legal/epl-2.0/</url>
    </license>
  </licenses>

  <organization>
    <name>openhab.org</name>
    <url>http://www.openhab.org</url>
  </organization>

  <developers>
    <developer>
      <name>Svilen Valkanov</name>
      <email>svilen.valkanov@musala.com</email>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:git@github.com:openhab/static-code-analysis.git</connection>
    <developerConnection>scm:git:git@github.com:openhab/static-code-analysis.git</developerConnection>
    <url>git@github.com:openhab/static-code-analysis.git</url>
  </scm>
  <issueManagement>
    <system>github</system>
    <url>https://github.com/openhab/static-code-analysis/issues</url>
  </issueManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.eclipse.version>2.10</maven.eclipse.version>
    <junit.version>4.11</junit.version>
    <commons.io.version>2.4</commons.io.version>
    <commons.lang.version>2.6</commons.lang.version>
    <mockito.version>2.25.0</mockito.version>
    <maven.resources.version>2.4</maven.resources.version>
    <pmd.version>6.7.0</pmd.version>
    <checkstyle.version>8.12</checkstyle.version>
    <spotbugs.version>3.1.7</spotbugs.version>
    <maven.plugin.api.version>3.1.1</maven.plugin.api.version>
    <maven.plugin.annotations.version>3.5</maven.plugin.annotations.version>
    <maven.plugin.plugin.version>3.5</maven.plugin.plugin.version>
    <maven.plugin.compiler.version>3.6.1</maven.plugin.compiler.version>
    <mojo.executor.version>2.2.0</mojo.executor.version>
    <org.apache.ivy.version>2.4.0</org.apache.ivy.version>
    <org.jsoup.version>1.7.1</org.jsoup.version>
    <pde.core.version>3.11.1</pde.core.version>
    <sat.version>0.6.1</sat.version>
    <jdt-annotations.version>2.1.0</jdt-annotations.version>
    <flexmark.version>0.28.6</flexmark.version>
    <maven.surefire.plugin.version>2.12.4</maven.surefire.plugin.version>
    <jetty.server.version>9.3.14.v20161028</jetty.server.version>
    <saxon.version>9.1.0.8</saxon.version>
  </properties>

  <distributionManagement>
      <repository>
          <id>bintray</id>
          <url>https://api.bintray.com/maven/openhab/mvn/openhab-tools/;publish=1</url>
          <uniqueVersion>false</uniqueVersion>
      </repository>
  </distributionManagement>

  <repositories>
    <repository>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>never</updatePolicy>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>openhab-artifactory-release</id>
      <name>JFrog Artifactory Repository</name>
      <url>https://openhab.jfrog.io/openhab/libs-release</url>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>openhab-artifactory-release</id>
      <url>https://openhab.jfrog.io/openhab/libs-release</url>
    </pluginRepository>
  </pluginRepositories>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>3.0</version>
          <configuration>
            <basedir>${basedir}</basedir>
            <header>licenses/epl-2.0/header.txt</header>
            <quiet>false</quiet>
            <failIfMissing>true</failIfMissing>
            <strictCheck>true</strictCheck>
            <aggregate>true</aggregate>
            <mapping>
              <xml>xml-header-style</xml>
            </mapping>
            <headerDefinitions>
              <headerDefinition>licenses/epl-2.0/xml-header-style.xml</headerDefinition>
            </headerDefinitions>
            <includes>
              <include>**/org/openhab/**/*.java</include>
              <include>**/OSGI-INF/*.xml</include>
            </includes>
            <excludes>
              <exclude>**/pom.xml</exclude>
              <exclude>target/**</exclude>
              <exclude>**/org/openhab/tools/analysis/findbugs/CustomClassNameLengthDetector.java</exclude>
              <exclude>**/org/openhab/tools/analysis/report/ReportUtility.java</exclude>
            </excludes>
            <useDefaultExcludes>true</useDefaultExcludes>
            <properties>
              <year>2019</year>
            </properties>
            <encoding>UTF-8</encoding>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven.surefire.plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>${maven.eclipse.version}</version>
        <configuration>
          <downloadSources>true</downloadSources>
          <downloadJavadocs>true</downloadJavadocs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven.plugin.compiler.version}</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-compiler</artifactId>
            <version>2.9.2-01</version>
          </dependency>
          <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-batch</artifactId>
            <version>2.4.3-01</version>
          </dependency>
        </dependencies>
      </plugin>         
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>verify</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <attach>true</attach>
        </configuration>
      </plugin>
      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.1.0</version>
          <configuration>
              <source>8</source>
              <outputDirectory>${project.build.directory}/javadoc</outputDirectory>
              <failOnError>true</failOnError>
          </configuration>
          <executions>
              <execution>
                  <id>attach-javadocs</id>
                  <goals>
                      <goal>jar</goal>
                  </goals>
                  <configuration>
                      <additionalparam>${javadoc.opts}</additionalparam>
                  </configuration>
              </execution>
          </executions>
      </plugin>
    </plugins>
  </build>
  
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
      <version>2.2.11</version>
    </dependency>
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-core</artifactId>
      <version>2.2.11</version>
    </dependency>
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
      <version>2.2.11</version>
    </dependency>
    <dependency>
      <groupId>javax.activation</groupId>
      <artifactId>activation</artifactId>
      <version>1.1.1</version>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  
  <modules>
    <module>custom-checks</module>
    <module>sat-plugin</module>
  </modules>

  <profiles>
    <profile>
      <id>check</id>
      <activation>
        <property>
          <name>!skipChecks</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.openhab.tools.sat</groupId>
              <artifactId>sat-plugin</artifactId>
              <version>${sat.version}</version>
              <configuration>
                <checkstyleFilter>tools/suppressions.xml</checkstyleFilter>
                <checkstyleProperties>tools/checkstyle.properties</checkstyleProperties>
              </configuration>
              <executions>
                <execution>
                  <goals>
                    <goal>checkstyle</goal>
                    <goal>pmd</goal>
                    <goal>spotbugs</goal>
                    <goal>report</goal>
                  </goals>
                  <phase>verify</phase>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.openhab.tools.sat</groupId>
            <artifactId>sat-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
