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

    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>
  <parent>
    <groupId>io.atlasmap</groupId>
    <artifactId>atlas-parent</artifactId>
    <version>1.34.4</version>
    <relativePath>../parent</relativePath>
  </parent>

  <artifactId>atlas-runtime</artifactId>
  <packaging>pom</packaging>
  <name>AtlasMap Runtime</name>
  <description>AtlasMap runtime engine and design time services</description>

  <properties>
    <!-- Controls Docker Image Generation -->
    <from.image>registry.access.redhat.com/jboss-fuse-6/fis-java-openshift:2.0</from.image>
    <docker.image>atlasmap/atlasmap:%l</docker.image>
    <license.dir>${project.basedir}/src/main/resources/license</license.dir>
    <license.output.dir>${project.build.directory}/licenses</license.output.dir>
  </properties>

  <modules>
    <module>model</module>
    <module>api</module>
    <module>core</module>
    <module>service</module>
    <module>modules/java</module>
    <module>modules/json</module>
    <module>modules/xml</module>
    <module>itests</module>
    <module>atlasmap-maven-plugin</module>
    <module>runtime</module>
    <module>coverage-report</module>
  </modules>

  <profiles>
    <profile>
      <id>jacoco</id>
      <properties>
        <sonar.language>java</sonar.language>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>prepare-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <argLine>${argLine}</argLine>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>xml-format</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>xml-maven-plugin</artifactId>
            <version>1.0.1</version>
            <executions>
              <execution>
                <id>check-format-style</id>
                <phase>validate</phase>
                <goals>
                  <goal>check-format</goal>
                </goals>
                <configuration>
                  <formatFileSets>
                    <formatFileSet>
                      <directory>${project.basedir}/</directory>
                      <excludes>
                        <exclude>**/src/test/resources/**/*</exclude>
                        <exclude>**/target/**/*</exclude>
                        <exclude>**/*.java</exclude>
                        <exclude>**/*.json</exclude>
                        <exclude>**/.*</exclude>
                        <exclude>**/*.jar</exclude>
                        <exclude>**/*.properties</exclude>
                        <exclude>**/*.prefs</exclude>
                        <exclude>**/*.sh</exclude>
                        <exclude>**/*.cache</exclude>
                        <exclude>**/*.AtlasConverter</exclude>
                        <exclude>**/*.AtlasFieldAction</exclude>
                        <exclude>**/*.adoc</exclude>
                        <exclude>**/*.md</exclude>
                        <exclude>**/Jenkinsfile</exclude>
                        <exclude>**/*.cat</exclude>
                        <exclude>**/*.module</exclude>
                        <exclude>**/*.jsd</exclude>
                        <exclude>**/*.yml</exclude>
                        <exclude>**/*.yaml</exclude>
                        <exclude>**/*.xml2</exclude>
                      </excludes>
                    </formatFileSet>
                  </formatFileSets>
                  <indentSize>2</indentSize>
                  <skip>false</skip>
                  <useDefaultFormatFileSet>true</useDefaultFormatFileSet>
                  <failOnFormatViolation>true</failOnFormatViolation>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>generate-licenses-xml</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>aggregate-download-licenses</goal>
                </goals>
                <phase>generate-resources</phase>
                <configuration>
                  <licensesOutputDirectory>${license.dir}/licenses</licensesOutputDirectory>
                  <licensesOutputFile>${license.dir}/licenses.xml</licensesOutputFile>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
          <configLocation>../checkstyle.xml</configLocation>
          <propertyExpansion>
            checkstyle.suppression.file=../checkstyle-suppressions.xml
          </propertyExpansion>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
