<!--

    Copyright (c) 2016 Institut de recherches cliniques de Montreal (IRCM)

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses />.

-->
<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">
  <parent>
    <groupId>ca.qc.ircm</groupId>
    <artifactId>ircm-parent</artifactId>
    <version>2.1</version>
    <relativePath>../ircm-parent/pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>plate-layout</artifactId>
  <name>plate-layout</name>
  <version>0.2</version>
  <inceptionYear>2016</inceptionYear>
  <description>Layout for micro well plates used in laboratories</description>
  <url>http://bitbucket.org/ircm/plate-layout</url>
  <licenses>
    <license>
      <name>GNU Affero General Public License</name>
      <url>https://www.gnu.org/licenses/agpl.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:https://bitbucket.org/ircm/plate-layout.git</connection>
    <developerConnection>scm:git:https://bitbucket.org/ircm/plate-layout.git</developerConnection>
    <url>https://bitbucket.org/ircm/plate-layout</url>
  </scm>
  <issueManagement>
    <system>Bitbucket</system>
    <url>https://bitbucket.org/ircm/plate-layout/issues</url>
  </issueManagement>
  <properties>
    <javac.version>1.8</javac.version>
    <vaadin.version>7.7.6</vaadin.version>
    <spring-boot.version>1.4.3.RELEASE</spring-boot.version>
    <vaadin-spring-boot.version>1.1.1</vaadin-spring-boot.version>
    <vaadin-spring.version>1.1.1</vaadin-spring.version>
    <vaadin.testbench.version>4.1.0</vaadin.testbench.version>
    <testbench-tests.skip>true</testbench-tests.skip>
    <vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
    <mojolicense-maven-plugin.version>1.10</mojolicense-maven-plugin.version>
    <Implementation-Title>${project.name}</Implementation-Title>
    <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
    <Vaadin-License-Title>GNU Affero General Public License</Vaadin-License-Title>
    <Vaadin-Addon>${project.artifactId}-${project.version}.jar</Vaadin-Addon>
    <Vaadin-Widgetsets>ca.qc.ircm.platelayout.PlateLayoutWidgetset</Vaadin-Widgetsets>
    <Vaadin-Stylesheets>VAADIN/addons/platelayout/plate-layout.scss</Vaadin-Stylesheets>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-bom</artifactId>
        <version>${vaadin.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring-boot.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-testbench</artifactId>
      <version>${vaadin.testbench.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-testbench-core</artifactId>
      <version>${vaadin.testbench.version}</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.mortbay.jetty</groupId>
          <artifactId>servlet-api-2.5</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-firefox-driver</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-themes</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-spring</artifactId>
      <version>${vaadin-spring.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-spring-boot-starter</artifactId>
      <version>${vaadin-spring-boot.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-push</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-server</artifactId>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-client</artifactId>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-shared</artifactId>
    </dependency>
  </dependencies>
  <build>
    <sourceDirectory>src/main/java</sourceDirectory>
    <testSourceDirectory>src/test/java</testSourceDirectory>
    <resources>
      <resource>
        <directory>src/main/java</directory>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
      </testResource>
    </testResources>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
            <excludes>
              <exclude>ca/qc/ircm/platelayout/**/integration/**/*.java</exclude>
              <exclude>ca/qc/ircm/platelayout/test/**/*.java</exclude>
            </excludes>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-failsafe-plugin</artifactId>
          <configuration>
            <systemPropertyVariables>
              <testbench-tests.skip>${testbench-tests.skip}</testbench-tests.skip>
              <spring.devtools.restart.enabled>false</spring.devtools.restart.enabled>
            </systemPropertyVariables>
            <includes>
              <include>ca/qc/ircm/platelayout/**/integration/**/*.java</include>
            </includes>
          </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>
          <artifactId>maven-jar-plugin</artifactId>
          <configuration>
            <archive>
              <index>true</index>
              <manifest>
                <addClasspath>true</addClasspath>
              </manifest>
              <manifestEntries>
                <Vaadin-Package-Version>1</Vaadin-Package-Version>
                <Vaadin-License-Title>${Vaadin-License-Title}</Vaadin-License-Title>
                <Vaadin-Widgetsets>${Vaadin-Widgetsets}</Vaadin-Widgetsets>
                <Vaadin-Stylesheets>${Vaadin-Stylesheets}</Vaadin-Stylesheets>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>external.atlassian.jgitflow</groupId>
          <artifactId>jgitflow-maven-plugin</artifactId>
        </plugin>
        <plugin>
          <groupId>com.vaadin</groupId>
          <artifactId>vaadin-maven-plugin</artifactId>
          <version>${vaadin.plugin.version}</version>
          <configuration>
            <webappDirectory>${basedir}/target/test-classes/VAADIN/widgetsets</webappDirectory>
            <hostedWebapp>${basedir}/target/test-classes</hostedWebapp>
            <warSourceDirectory>${basedir}/src/main/resources</warSourceDirectory>
            <draftCompile>false</draftCompile>
            <compileReport>false</compileReport>
            <style>OBF</style>
            <strict>true</strict>
            <logLevel>INFO</logLevel>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>compile</goal>
              </goals>
            </execution>
          </executions>
          <dependencies>
            <dependency>
              <groupId>com.vaadin</groupId>
              <artifactId>vaadin-client-compiler</artifactId>
              <version>${vaadin.version}</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <configuration>
            <headerDefinitions>
              <headerDefinition>src/license/javacomment_style.xml</headerDefinition>
            </headerDefinitions>
            <mapping>
              <java>JAVACOMMENT_STYLE</java>
              <ini>SEMICOLON_STYLE</ini>
              <scss>JAVADOC_STYLE</scss>
            </mapping>
            <excludes>
              <exclude>**/README</exclude>
              <exclude>**/.*</exclude>
              <exclude>src/test/resources/VAADIN/themes/**/addons.scss</exclude>
            </excludes>
            <executions>
              <execution>
                <goals><goal>check</goal></goals>
              </execution>
            </executions>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>${mojolicense-maven-plugin.version}</version>
          <configuration>
            <useMissingFile>true</useMissingFile>
          </configuration>
          <executions>
            <execution>
              <id>license-add-third-party</id>
              <goals><goal>add-third-party</goal></goals>
            </execution>
            <execution>
              <id>license-download-licenses</id>
              <goals><goal>download-licenses</goal></goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
  <reporting>
    <plugins>
      <plugin>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <configuration>
          <reportsDirectories>
            <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
            <reportsDirectory>${project.build.directory}/failsafe-reports</reportsDirectory>
          </reportsDirectories>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </reporting>
  <profiles>
    <profile>
      <id>vaadin-repository</id>
      <activation>
        <property>
          <name>vaadin-repository</name>
          <value>!false</value>
        </property>
      </activation>
      <repositories>
        <repository>
          <id>vaadin-addons</id>
          <url>http://maven.vaadin.com/vaadin-addons</url>
        </repository>
      </repositories>
    </profile>
    <profile>
      <id>test-testbench</id>
      <properties>
        <testbench-tests.skip>false</testbench-tests.skip>
      </properties>
    </profile>
  </profiles>
</project>
