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

    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You 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>org.apache.camel</groupId>
    <artifactId>core</artifactId>
    <version>3.0.0-M1</version>
    <relativePath>..</relativePath>
  </parent>

  <artifactId>camel-core</artifactId>
  <packaging>jar</packaging>
  <name>Camel :: Core</name>
  <description>The Core Camel Java DSL based router</description>

  <properties>
    <camel.osgi.dynamic>
      org.apache.camel.spring.util;${camel.osgi.import.strict.version},
      org.apache.camel.spring.pollingconsumer;${camel.osgi.import.strict.version},
      org.apache.camel.processor.interceptor.jpa;${camel.osgi.import.strict.version},
      org.apache.camel.pollconsumer.quartz2;${camel.osgi.import.strict.version},
      net.sf.saxon
    </camel.osgi.dynamic>
  </properties>

  <dependencies>

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>spi-annotations</artifactId>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>meta-annotations</artifactId>
      <optional>true</optional>
    </dependency>

    <!-- required dependencies by camel-core -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-util</artifactId>
    </dependency>

    <!-- required dependencies by camel-core -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-api</artifactId>
    </dependency>

    <!-- required dependencies by camel-core -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-management-api</artifactId>
    </dependency>

    <!-- required dependencies by camel-core -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-base</artifactId>
    </dependency>

    <!-- required dependencies by camel-core -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-support</artifactId>
    </dependency>

    <!-- core components -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-browse</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-controlbus</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-dataformat</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-direct</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-directvm</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-file</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-language</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-log</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-properties</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-ref</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-rest</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-saga</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-scheduler</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-seda</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-stub</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-timer</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-validator</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-vm</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-xslt</artifactId>
    </dependency>

    <!-- required dependencies by camel-core -->
    <!-- which we shade into camel-core so its available for everybody out of the box -->
    <dependency>
      <groupId>com.github.ben-manes.caffeine</groupId>
      <artifactId>caffeine</artifactId>
    </dependency>
    <!-- we shade our patched ordered json-simple parser -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-util-json</artifactId>
    </dependency>

    <!-- required dependencies by camel-core -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>

    <!-- osgi support -->
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>osgi.core</artifactId>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>osgi.cmpn</artifactId>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>

    <!-- testing -->
    <dependency>
      <groupId>org.codehaus.woodstox</groupId>
      <artifactId>woodstox-core-asl</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-core</artifactId>
      <version>1.21</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-generator-annprocess</artifactId>
      <version>1.21</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>java-hamcrest</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- logging -->
    <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.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- for json tests -->
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <scope>test</scope>
    </dependency>

    <!-- validator -->
    <dependency>
      <groupId>xml-resolver</groupId>
      <artifactId>xml-resolver</artifactId>
      <version>${xml-resolver-version}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>


  <build>
    <pluginManagement>
      <plugins>
        <!-- Eclipse m2e Lifecycle Management -->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>${lifecycle-mapping-version}</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.camel</groupId>
                    <artifactId>camel-package-maven-plugin</artifactId>
                    <versionRange>${project.version}</versionRange>
                    <goals>
                      <goal>generate-eips-list</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
          <execution>
            <id>default-testCompile</id>
            <phase>process-test-sources</phase>
            <goals>
              <goal>testCompile</goal>
            </goals>
            <configuration>
              <proc>none</proc>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- generate the attached tests jar -->
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <excludes>
            <exclude>log4j.properties</exclude>
          </excludes>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <!-- skip file stress tests as they are intended to run manually -->
          <excludes>
            <exclude>org/apache/camel/component/file/stress/**.java</exclude>
            <exclude>**/DistributedCompletionIntervalTest.java</exclude>
            <exclude>**/DistributedConcurrentPerCorrelationKeyTest.java</exclude>
            <exclude>${platform.skip.tests}</exclude>
          </excludes>
          <forkedProcessTimeoutInSeconds>3000</forkedProcessTimeoutInSeconds>
          <!-- needed for testing the properties component -->
          <environmentVariables>
            <FOO_SERVICE_HOST>myserver</FOO_SERVICE_HOST>
            <FOO_SERVICE_PORT>8081</FOO_SERVICE_PORT>
          </environmentVariables>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-package-maven-plugin</artifactId>
        <version>${project.version}</version>
        <configuration>
          <!-- set to true to make build fail fast if missing documentation in docs files -->
          <failFast>false</failFast>
        </configuration>
        <executions>
          <execution>
            <id>generate</id>
            <goals>
              <goal>generate-jaxb-list</goal>
              <goal>generate-eips-list</goal>
              <goal>generate-components-list</goal>
              <goal>generate-dataformats-list</goal>
              <goal>generate-languages-list</goal>
            </goals>
            <phase>process-classes</phase>
          </execution>
          <execution>
            <id>validate</id>
            <goals>
              <goal>validate-components</goal>
              <goal>prepare-spring-boot-starter</goal>
              <goal>prepare-spring-boot-auto-configuration</goal>
            </goals>
            <phase>prepare-package</phase>
          </execution>
          <execution>
            <id>readme</id>
            <goals>
              <goal>update-readme</goal>
            </goals>
            <phase>package</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-generated-resources</id>
            <goals>
              <goal>resources</goal>
            </goals>
            <phase>process-classes</phase>
            <configuration>
              <resources>
                <resource>
                  <directory>${basedir}/target/generated/camel/components</directory>
                </resource>
                <resource>
                  <directory>${basedir}/target/generated/camel/dataformats</directory>
                </resource>
                <resource>
                  <directory>${basedir}/target/generated/camel/languages</directory>
                </resource>
                <resource>
                  <directory>${basedir}/target/generated/camel/models</directory>
                </resource>
                <resource>
                  <directory>${basedir}/target/generated/camel/jaxb</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <configuration>
          <instructions>
            <_plugin>
              org.apache.felix.bundleplugin.BlueprintPlugin,
              aQute.lib.spring.SpringXMLType,
              org.apache.felix.bundleplugin.JpaPlugin,
              org.apache.camel.maven.bundle.CamelPlugin
            </_plugin>
          </instructions>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-bundle-plugin</artifactId>
            <version>${project.version}</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <links>
            <link>http://download.oracle.com/javase/7/docs/api/</link>
            <link>http://download.oracle.com/javaee/7/api/</link>
          </links>
          <linksource>true</linksource>
          <maxmemory>256m</maxmemory>
          <groups>
            <group>
              <title>Camel API</title>
              <packages>org.apache.camel</packages>
            </group>
            <group>
              <title>Fluent API (DSL) for building EIP rules</title>
              <packages>org.apache.camel.builder:org.apache.camel.builder.*</packages>
            </group>
            <group>
              <title>EIP model</title>
              <packages>org.apache.camel.model:org.apache.camel.model.*</packages>
            </group>
            <group>
              <title>Camel Components</title>
              <packages>org.apache.camel.component:org.apache.camel.component.*</packages>
            </group>
            <group>
              <title>Language APIs and plugins for Expressions and Predicates</title>
              <packages>org.apache.camel.language:org.apache.camel.language.*</packages>
            </group>
            <group>
              <title>Processors to implement the Enterprise Integration Patterns</title>
              <packages>org.apache.camel.processor:org.apache.camel.processor.*</packages>
            </group>
            <group>
              <title>Strategy APIs for implementors extending Camel</title>
              <packages>org.apache.camel.spi</packages>
            </group>
            <group>
              <title>Support APIs for implementors</title>
              <packages>org.apache.camel.support:org.apache.camel.support.*</packages>
            </group>
            <group>
              <title>Management (JMX) API</title>
              <packages>org.apache.camel.management:org.apache.camel.management.*:org.apache.camel.api.management.mbean</packages>
            </group>
            <group>
              <title>Camel Runtime</title>
              <packages>org.apache.camel.impl:org.apache.camel.impl.*</packages>
            </group>
            <group>
              <title>Camel Main to run Camel standalone</title>
              <packages>org.apache.camel.main</packages>
            </group>
            <group>
              <title>Type conversion helper classes</title>
              <packages>org.apache.camel.converter:org.apache.camel.converter.*</packages>
            </group>
            <group>
              <title>Utility classes</title>
              <packages>org.apache.camel.util:org.apache.camel.util.*</packages>
            </group>
          </groups>
        </configuration>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>package</id>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <links>
                <link>http://download.oracle.com/javase/7/docs/api/</link>
                <link>http://download.oracle.com/javaee/7/api/</link>
              </links>
              <linksource>true</linksource>
              <maxmemory>256m</maxmemory>
              <groups>
                <group>
                  <title>Camel API</title>
                  <packages>org.apache.camel</packages>
                </group>
                <group>
                  <title>Fluent API (DSL) for building EIP rules</title>
                  <packages>org.apache.camel.builder:org.apache.camel.builder.*</packages>
                </group>
                <group>
                  <title>EIP model</title>
                  <packages>org.apache.camel.model:org.apache.camel.model.*</packages>
                </group>
                <group>
                  <title>Camel Components</title>
                  <packages>org.apache.camel.component:org.apache.camel.component.*</packages>
                </group>
                <group>
                  <title>Language APIs and plugins for Expressions and Predicates</title>
                  <packages>org.apache.camel.language:org.apache.camel.language.*</packages>
                </group>
                <group>
                  <title>Processors to implement the Enterprise Integration Patterns</title>
                  <packages>org.apache.camel.processor:org.apache.camel.processor.*</packages>
                </group>
                <group>
                  <title>Strategy APIs for implementors extending Camel</title>
                  <packages>org.apache.camel.spi</packages>
                </group>
                <group>
                  <title>Support APIs for implementors</title>
                  <packages>org.apache.camel.support:org.apache.camel.support.*</packages>
                </group>
                <group>
                  <title>Management (JMX) API</title>
                  <packages>org.apache.camel.management:org.apache.camel.management.*:org.apache.camel.api.management.mbean</packages>
                </group>
                <group>
                  <title>Camel Runtime</title>
                  <packages>org.apache.camel.impl:org.apache.camel.impl.*</packages>
                </group>
                <group>
                  <title>Camel Main to run Camel standalone</title>
                  <packages>org.apache.camel.main</packages>
                </group>
                <group>
                  <title>Type conversion helper classes</title>
                  <packages>org.apache.camel.converter:org.apache.camel.converter.*</packages>
                </group>
                <group>
                  <title>Utility classes</title>
                  <packages>org.apache.camel.util:org.apache.camel.util.*</packages>
                </group>
              </groups>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- enables the APT dependency so that it can be disabled in IDE builds -->
    <profile>
      <id>apt</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>

      <dependencies>

        <!-- enable the APT processor -->
        <dependency>
          <groupId>org.apache.camel</groupId>
          <artifactId>apt</artifactId>
          <scope>provided</scope>
        </dependency>

      </dependencies>
    </profile>

    <!-- skip management tests on AIX as it hangs CI servers -->
    <profile>
      <id>aix</id>
      <activation>
        <os>
          <name>aix</name>
        </os>
      </activation>
      <properties>
        <platform.skip.tests>org/apache/camel/management/**/*.java</platform.skip.tests>
      </properties>
    </profile>
    <profile>
      <id>xalan</id>
      <dependencies>
        <!-- enable the Xalan processor -->
        <dependency>
          <groupId>xalan</groupId>
          <artifactId>xalan</artifactId>
          <version>${xalan-version}</version>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>xerces</id>
      <dependencies>
        <!-- enable the xerces processor -->
        <dependency>
          <groupId>xerces</groupId>
          <artifactId>xercesImpl</artifactId>
          <version>${xerces-version}</version>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>woodstox</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <dependencies>
        <!-- xmltokenizer using woodstox -->
        <dependency>
          <groupId>org.codehaus.woodstox</groupId>
          <artifactId>woodstox-core-asl</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>jdk9+-build</id>
      <activation>
        <jdk>[9,)</jdk>
      </activation>
      <dependencies>

        <!-- enable the APT processor -->
        <dependency>
          <groupId>org.apache.camel</groupId>
          <artifactId>apt</artifactId>
          <scope>provided</scope>
        </dependency>
        <!-- xmltokenizer using woodstox -->
        <dependency>
          <groupId>org.codehaus.woodstox</groupId>
          <artifactId>woodstox-core-asl</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <!-- skip file stress tests as they are intended to run manually -->
              <excludes>
                <exclude>org/apache/camel/component/file/stress/**.java</exclude>
                <exclude>**/DistributedCompletionIntervalTest.java</exclude>
                <exclude>**/DistributedConcurrentPerCorrelationKeyTest.java</exclude>
                <exclude>${platform.skip.tests}</exclude>
              </excludes>
              <forkedProcessTimeoutInSeconds>3000</forkedProcessTimeoutInSeconds>
              <!-- needed for testing the properties component -->
              <environmentVariables>
              <FOO_SERVICE_HOST>myserver</FOO_SERVICE_HOST>
              <FOO_SERVICE_PORT>8081</FOO_SERVICE_PORT>
              </environmentVariables>
            </configuration>
            <dependencies>
              <dependency>
                <groupId>jakarta.xml.bind</groupId>
                <artifactId>jakarta.xml.bind-api</artifactId>
                <version>${jakarta-jaxb-version}</version>
              </dependency>
              <dependency>
                <groupId>org.glassfish.jaxb</groupId>
                <artifactId>jaxb-runtime</artifactId>
                <version>${glassfish-jaxb-runtime-version}</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
