<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2017 Red Hat, Inc.

    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>io.atlasmap</groupId>
  <artifactId>atlasmapio</artifactId>
  <version>1.32.2</version>
  <packaging>pom</packaging>
  <name>AtlasMap Project</name>
  <description>AtlasMap Project</description>
  <url>https://atlasmap.io/</url>
  <scm>
    <connection>scm:git:https://github.com/atlasmap/atlasmap.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/atlasmap/atlasmap.git</developerConnection>
    <url>http://github.com/atlasmap/atlasmap</url>
    <tag>atlasmap-1.32.2</tag>
  </scm>
  <organization>
    <name>JBoss by Red Hat</name>
    <url>http://jboss.org</url>
  </organization>
  <issueManagement>
    <system>github</system>
    <url>https://github.com/atlasmap/atlasmap/issues</url>
  </issueManagement>
  <developers>
    <developer>
      <name>AtlasMap committers</name>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <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>
    <frontend-maven-plugin-version>1.6</frontend-maven-plugin-version>
    <node.version>v8.9.1</node.version>
    <npm.version>5.5.1</npm.version>
    <yarn.version>v1.3.2</yarn.version>
  </properties>

  <modules>
    <module>parent</module>
    <module>runtime</module>
    <module>camel</module>
    <!-- <module>app</module> -->
  </modules>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.github.eirslett</groupId>
          <artifactId>frontend-maven-plugin</artifactId>
          <version>${frontend-maven-plugin-version}</version>
          <executions>
            <execution>
              <id>install node and npm</id>
              <goals>
                <goal>install-node-and-npm</goal>
              </goals>
              <configuration>
                <nodeVersion>${node.version}</nodeVersion>
              </configuration>
            </execution>
            <execution>
              <id>install yarn</id>
              <goals>
                <goal>install-node-and-yarn</goal>
              </goals>
              <configuration>
                <nodeVersion>${node.version}</nodeVersion>
                <npmVersion>${npm.version}</npmVersion>
                <yarnVersion>${yarn.version}</yarnVersion>
              </configuration>
            </execution>
            <execution>
              <id>angular-cli install</id>
              <goals>
                <goal>npm</goal>
              </goals>
              <configuration>
                <arguments>install --no-optional @angular/cli</arguments>
              </configuration>
            </execution>
            <execution>
              <id>yarn install</id>
              <goals>
                <goal>yarn</goal>
              </goals>
              <configuration>
                <arguments>install --no-progress</arguments>
              </configuration>
            </execution>
            <execution>
              <id>yarn ng build</id>
              <goals>
                <goal>yarn</goal>
              </goals>
              <configuration>
                <arguments>ng build -- --aot --prod --progress=false</arguments>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5.3</version>
        </plugin>

        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.0.2</version>
          <configuration>
            <archive>
              <addMavenDescriptor>true</addMavenDescriptor>
            </archive>
          </configuration>
        </plugin>

        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.4</version>
        </plugin>

      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>ui</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <modules>
        <module>ui</module>
      </modules>
    </profile>
    <profile>
      <id>java8-doclint-disabled</id>
      <activation>
        <jdk>[1.8,)</jdk>
      </activation>
      <properties>
        <javadoc.opts>-Xdoclint:none</javadoc.opts>
      </properties>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-deploy-plugin</artifactId>
            <configuration>
              <skip>false</skip>
            </configuration>
          </plugin>
          <plugin>
            <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>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <additionalparam>${javadoc.opts}</additionalparam>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-release-plugin</artifactId>
            <configuration>
              <checkModificationExcludes>
                <exclude>**/package-lock.json</exclude>
                <exclude>**/package.json</exclude>
                <exclude>**/yarn.lock</exclude>
              </checkModificationExcludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>community-release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
              <serverId>oss-sonatype-staging</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>false</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
