<?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>

  <groupId>org.llorllale</groupId>
  <artifactId>youtrack-api</artifactId>
  <version>0.9.0</version>

  <packaging>jar</packaging>

  <name>youtrack-api</name>
  <description>Fluent, object-oriented Java API for YouTrack.</description>
  <url>https://github.com/llorllale/youtrack-api</url>
  <inceptionYear>2017</inceptionYear>

  <organization>
    <name>George Aristy</name>
    <url>https://llorllale.github.io/</url>
  </organization>

  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <distribution>repo</distribution>
      <url>LICENSE</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>llorllale</id>
      <name>George Aristy</name>
      <url>https://llorllale.github.io/</url>
      <email>george.aristy@gmail.com</email>
      <roles>
        <role>Architect</role>
        <role>Developer</role>
      </roles>
      <timezone>-4</timezone>
    </developer>
  </developers>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/llorllale/youtrack-api/issues</url>
  </issueManagement>

  <scm>
    <connection>scm:git:git@github.com:llorllale/youtrack-api.git</connection>
    <developerConnection>scm:git:git@github.com:llorllale/youtrack-api.git</developerConnection>
    <url>https://github.com/llorllale/youtrack-api</url>
  </scm>

  <ciManagement>
    <system>Travis CI</system>
    <url>https://travis-ci.org/llorllale/youtrack-api</url>
  </ciManagement>

  <distributionManagement>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <netbeans.hint.license>apache20</netbeans.hint.license>
    <netbeans.hint.projectversion>${project.version}</netbeans.hint.projectversion>
    <youtrackVersion>2017.3.35488</youtrackVersion>
    <youtrack.test.docker.name>${project.artifactId}-integration-tests</youtrack.test.docker.name>
    <youtrack.test.user>root</youtrack.test.user>
    <youtrack.test.user.token>perm:cm9vdA==.eW91dHJhY2stYXBpLXRlc3Q=.nOe5IYpv520S120tK18hc2tkm8oCI4</youtrack.test.user.token>
    <youtrack.test.pwd>youtrack</youtrack.test.pwd>
    <youtrack.test.baseUrl>http://localhost:18080</youtrack.test.baseUrl>
    <youtrack.test.url>${youtrack.test.baseUrl}/rest</youtrack.test.url>
    <youtrack.test.project.id>TP</youtrack.test.project.id>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.5.1</version>
    </dependency>
    <dependency>
      <groupId>com.jamesmurty.utils</groupId>
      <artifactId>java-xmlbuilder</artifactId>
      <version>1.2</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.hamcrest</groupId>
          <artifactId>hamcrest-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <version>1.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.6</version>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>23.0</version>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>integration-tests</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>site</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
      <reporting>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>2.6</version>
            <reportSets>
              <reportSet>
                <reports>
                  <report>index</report>
                  <report>license</report>
                  <report>project-team</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <reportSets>
              <reportSet>
                <reports>
                  <report>javadoc</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <reportSets>
              <reportSet>
                <reports>
                  <report>checkstyle</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </reporting>
    </profile>
    <profile>
      <id>deploy</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <testResources>
      <testResource>
        <directory>${basedir}/src/test/resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>integration-tests-config.properties</include>
          <include>**/Dockerfile</include>
        </includes>
      </testResource>
    </testResources>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>2.20</version>
          <executions>
            <execution>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>io.fabric8</groupId>
          <artifactId>docker-maven-plugin</artifactId>
          <version>0.21.0</version>
          <configuration>
            <!--<showLogs>true</showLogs>-->
          </configuration>
          <executions>
            <execution>
              <id>youtrack-build</id>
              <phase>pre-integration-test</phase>
              <goals>
                <goal>build</goal>
              </goals>
              <configuration>
                <images>
                  <image>
                    <alias>youtrack-api-integration-test</alias>
                    <name>${youtrack.test.docker.name}</name>
                    <build>
                      <dockerFileDir>${basedir}/src/test/resources/docker</dockerFileDir>
                    </build>
                  </image>
                </images>
              </configuration>
            </execution>
            <execution>
              <id>youtrack-start</id>
              <phase>pre-integration-test</phase>
              <goals>
                <goal>start</goal>
              </goals>
              <configuration>
                <images>
                  <image>
                    <alias>youtrack-api-integration-test</alias>
                    <name>${youtrack.test.docker.name}</name>
                    <run>
                      <ports>
                        <port>18080:80</port>
                      </ports>
                      <wait>
                        <http>
                          <url>${youtrack.test.baseUrl}</url>
                          <method>GET</method>
                          <status>302</status>
                        </http>
                        <time>120000</time>
                      </wait>
                    </run>
                  </image>
                </images>
              </configuration>
            </execution>
            <execution>
              <id>youtrack-stop</id>
              <phase>post-integration-test</phase>
              <goals>
                <goal>stop</goal>
              </goals>
              <configuration>
                <alias>youtrack-api-integration-test</alias>
                <name>${youtrack.test.docker.name}</name>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.3</version>
          <configuration>
            <skipDeploy>true</skipDeploy>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>lt.velykis.maven.skins</groupId>
              <artifactId>reflow-velocity-tools</artifactId>
              <version>1.1.1</version>
            </dependency>
            <dependency>
              <groupId>org.apache.velocity</groupId>
              <artifactId>velocity</artifactId>
              <version>1.7</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>2.17</version>
          <executions>
            <execution>
              <id>validate</id>
              <phase>validate</phase>
              <goals>
                <goal>check</goal>
              </goals>
              <configuration>
                <configLocation>google_checks.xml</configLocation>
                <encoding>UTF-8</encoding>
                <consoleOutput>true</consoleOutput>
                <failsOnError>true</failsOnError>
                <linkXRef>false</linkXRef>
                <violationSeverity>info</violationSeverity>
                <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <version>3.0.5</version>
          <executions>
            <execution>
              <id>findbugs</id>
              <phase>validate</phase>
              <goals>
                <goal>check</goal>
              </goals>
              <configuration>
                <failOnError>true</failOnError>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>cobertura-maven-plugin</artifactId>
          <version>2.7</version>
          <configuration>
            <check/>
            <formats>
              <format>html</format>
              <format>xml</format>
            </formats>
            <instrumentation>
              <ignores>
                <ignore>org.llorllale.youtrack.api.jaxb.*</ignore>
              </ignores>
              <excludes>
                <exclude>org/llorllale/youtrack/api/jaxb/*.class</exclude>
              </excludes>
            </instrumentation>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>jaxb2-maven-plugin</artifactId>
          <version>2.3</version>
          <executions>
            <execution>
              <id>xjc</id>
              <phase>generate-sources</phase>
              <goals>
                <goal>xjc</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <packageName>org.llorllale.youtrack.api.jaxb</packageName>
            <createJavaDocAnnotations>false</createJavaDocAnnotations>
            <generateEpisode>false</generateEpisode>
            <addGeneratedAnnotation>false</addGeneratedAnnotation>
            <clearOutputDir>true</clearOutputDir>
            <outputDirectory>${project.build.directory}/generated-sources/jaxb</outputDirectory>
            <sources>
              <source>src/main/resources/schema</source>
            </sources>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.2.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.4</version>
          <configuration>
            <excludePackageNames>org.llorllale.youtrack.api.jaxb,org.llorllale.youtrack.api.util</excludePackageNames>
            <level>protected</level>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jaxb2-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
</project>
