<!--
    Copyright 2015 Alexey Andreev.

    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 License.
-->
<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>com.frequal.flavour</groupId>
  <artifactId>teavm-flavour</artifactId>
  <version>0.3.2</version>
  <packaging>pom</packaging>

  <name>TeaVM Flavour - Parent</name>
  <description>Flavour is a lightweight, fast framework for making modern web apps using Java</description>
  <url>https://flavour.sourceforge.io/</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>
      <comments>A business-friendly OSS license</comments>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>scram-team</id>
      <name>ScraM Team</name>
      <email>scramdevs@gmail.com</email>
    </developer>
  </developers>

  <scm>
    <url>https://sourceforge.net/projects/flavour/tags/teavm-flavour-0.3.2</url>
    <connection>scm:svn:svn://svn.code.sf.net/p/flavour/tags/teavm-flavour-0.3.2</connection>
  </scm>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <slf4j.version>1.7.7</slf4j.version>
    <teavm.version>0.6.1</teavm.version>
    <jackson.version>2.5.4</jackson.version>
    <antlr.version>4.6</antlr.version>
    <selenium.version>2.51.0</selenium.version>
    <sonatypeOssDistMgmtSnapshotsUrl>https://oss.sonatype.org/content/repositories/snapshots/</sonatypeOssDistMgmtSnapshotsUrl>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-all</artifactId>
        <version>1.3</version>
      </dependency>
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.4</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.teavm</groupId>
        <artifactId>teavm-core</artifactId>
        <version>${teavm.version}</version>
      </dependency>
      <dependency>
        <groupId>org.teavm</groupId>
        <artifactId>teavm-jso</artifactId>
        <version>${teavm.version}</version>
      </dependency>
      <dependency>
        <groupId>org.teavm</groupId>
        <artifactId>teavm-jso-apis</artifactId>
        <version>${teavm.version}</version>
      </dependency>
      <dependency>
        <groupId>org.teavm</groupId>
        <artifactId>teavm-jso-impl</artifactId>
        <version>${teavm.version}</version>
      </dependency>
      <dependency>
        <groupId>org.teavm</groupId>
        <artifactId>teavm-classlib</artifactId>
        <version>${teavm.version}</version>
      </dependency>
      <dependency>
        <groupId>org.teavm</groupId>
        <artifactId>teavm-platform</artifactId>
        <version>${teavm.version}</version>
      </dependency>
      <dependency>
        <groupId>org.teavm</groupId>
        <artifactId>teavm-junit</artifactId>
        <version>${teavm.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.teavm</groupId>
        <artifactId>teavm-interop</artifactId>
        <version>${teavm.version}</version>
      </dependency>
      <dependency>
        <groupId>org.teavm</groupId>
        <artifactId>teavm-metaprogramming-api</artifactId>
        <version>${teavm.version}</version>
      </dependency>
      <dependency>
        <groupId>org.teavm</groupId>
        <artifactId>teavm-metaprogramming-impl</artifactId>
        <version>${teavm.version}</version>
      </dependency>
      <dependency>
        <groupId>net.htmlparser.jericho</groupId>
        <artifactId>jericho-html</artifactId>
        <version>3.3</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>${jackson.version}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson.version}</version>
      </dependency>
      <dependency>
        <groupId>org.ow2.asm</groupId>
        <artifactId>asm-debug-all</artifactId>
        <version>5.0.4</version>
      </dependency>
      <dependency>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4-runtime</artifactId>
        <version>${antlr.version}</version>
      </dependency>
      <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>${selenium.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-htmlunit-driver</artifactId>
        <version>${selenium.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>2.5.1</version>
          <configuration>
            <source>1.8</source>
            <target>1.8</target>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.9.1</version>
          <executions>
            <execution>
              <id>build-javadoc</id>
              <goals>
                <goal>jar</goal>
              </goals>
              <phase>package</phase>
            </execution>
          </executions>
          <configuration>
            <show>protected</show>
            <failOnError>false</failOnError>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.2.1</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <phase>package</phase>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.17</version>
          <configuration>
            <argLine>-Xmx512m</argLine>
            <systemProperties>
              <teavm.junit.target>${project.build.directory}/js-tests</teavm.junit.target>
              <teavm.junit.js.runner>htmlunit</teavm.junit.js.runner>
              <teavm.junit.minified>true</teavm.junit.minified>
              <teavm.junit.optimized>true</teavm.junit.optimized>
            </systemProperties>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>2.17</version>
          <configuration>
            <systemProperties>
              <teavm.junit.target>${project.build.directory}/js-tests</teavm.junit.target>
              <teavm.junit.js.runner>htmlunit</teavm.junit.js.runner>
              <teavm.junit.minified>true</teavm.junit.minified>
              <teavm.junit.optimized>true</teavm.junit.optimized>
            </systemProperties>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.antlr</groupId>
          <artifactId>antlr4-maven-plugin</artifactId>
          <version>${antlr.version}</version>
          <executions>
            <execution>
              <id>antlr</id>
              <goals>
                <goal>antlr4</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>3.1.0</version>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>8.21</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <id>validate</id>
              <phase>validate</phase>
              <configuration>
                <encoding>UTF-8</encoding>
                <consoleOutput>true</consoleOutput>
                <failsOnError>true</failsOnError>
              </configuration>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <propertyExpansion>config_loc=${basedir}/..</propertyExpansion>
            <configLocation>../checkstyle.xml</configLocation>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>1.5</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.7</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>
      -->

      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>0.4.0</version>
        <extensions>true</extensions>
        <configuration>
          <publishingServerId>central</publishingServerId>
          <tokenAuth>true</tokenAuth>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <modules>
    <module>expr</module>
    <module>templates</module>
    <module>widgets</module>
    <module>regex</module>
    <module>routing</module>
    <module>json</module>
    <module>rest</module>
    <module>archetype</module>
    <module>archetype-minimal</module>
  </modules>

  <profiles>
    <profile>
      <id>with-example</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <modules>
        <module>example</module>
      </modules>
    </profile>
  </profiles>
</project>
