<!--

    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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>io.atlasmap</groupId>
    <artifactId>atlas-parent</artifactId>
    <version>2.3.2</version>
    <relativePath>../parent</relativePath>
  </parent>
  <artifactId>camel-atlasmap</artifactId>
  <packaging>bundle</packaging>
  <name>camel-atlasmap</name>
  <description>Camel component to perform AtlasMap data mapping as a part of Camel route</description>
  <properties>
    <osgi.export.pkg>org.apache.camel.component.atlasmap</osgi.export.pkg>
    <osgi.export.service>org.apache.camel.spi.ComponentResolver;component=atlas</osgi.export.service>
  </properties>
  <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>
    </license>
  </licenses>
  <dependencies>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-core</artifactId>
    </dependency>
    <dependency>
      <groupId>io.atlasmap</groupId>
      <artifactId>atlas-api</artifactId>
    </dependency>
    <dependency>
      <groupId>io.atlasmap</groupId>
      <artifactId>atlas-core</artifactId>
    </dependency>
    <dependency>
      <groupId>io.atlasmap</groupId>
      <artifactId>atlas-java-module</artifactId>
    </dependency>
    <dependency>
      <groupId>io.atlasmap</groupId>
      <artifactId>atlas-json-module</artifactId>
    </dependency>
    <dependency>
      <groupId>io.atlasmap</groupId>
      <artifactId>atlas-xml-module</artifactId>
    </dependency>
    <dependency>
      <groupId>io.atlasmap</groupId>
      <artifactId>atlas-csv-module</artifactId>
    </dependency>
    <dependency>
      <groupId>io.atlasmap</groupId>
      <artifactId>atlas-dfdl-module</artifactId>
      <scope>provided</scope>
    </dependency>
    <!-- for testing -->
    <dependency>
      <groupId>io.atlasmap</groupId>
      <artifactId>atlas-java-test-model</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.atlasmap</groupId>
      <artifactId>atlas-xml-test-model</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-test-spring</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-core-xml</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-spring-javaconfig</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j-impl</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.woodstox</groupId>
      <artifactId>woodstox-core-asl</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.twitter4j</groupId>
      <artifactId>twitter4j-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.xmlunit</groupId>
      <artifactId>xmlunit-assertj</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.xmlunit</groupId>
      <artifactId>xmlunit-matchers</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <profiles>
    <profile>
      <id>jacoco</id>
      <properties>
        <sonar.language>java</sonar.language>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <argLine>${argLine}</argLine>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>prepare-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
              <execution>
                <id>report</id>
                <phase>verify</phase>
                <goals>
                  <goal>report</goal>
                </goals>
                <configuration>
                  <includes>
                    <include>**/*.class</include>
                  </includes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>java9plus</id>
      <activation>
        <jdk>[9,)</jdk>
       </activation>
       <dependencies>
        <dependency>
          <groupId>javax.activation</groupId>
          <artifactId>activation</artifactId>
        </dependency>
       </dependencies>
    </profile>
  </profiles>
  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.camel</groupId>
                    <artifactId>camel-package-maven-plugin</artifactId>
                    <versionRange>[2.19.0.fuse-000035,)</versionRange>
                    <goals>
                      <goal>prepare-components</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>filter</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>resources</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>target/classes/features.xml</file>
                  <type>xml</type>
                  <classifier>features</classifier>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
