<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (C) 2006-2021 Talend Inc. - www.talend.com
   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>org.talend.sdk.component</groupId>
    <artifactId>component-runtime</artifactId>
    <version>1.32.2</version>
  </parent>

  <artifactId>component-runtime-manager</artifactId>

  <name>Component Runtime :: Manager</name>
  <description>Core of the framework, the manager allows to access components and instantiate them.</description>

  <properties>
    <talend.build.name>${talend.build.name.base}.manager</talend.build.name>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>component-spi</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>component-runtime-impl</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>container-core</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.xbean</groupId>
      <artifactId>xbean-finder-shaded</artifactId>
      <version>${xbean.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.xbean</groupId>
      <artifactId>xbean-reflect</artifactId>
      <version>${xbean.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.xbean</groupId>
      <artifactId>xbean-asm9-shaded</artifactId>
      <version>${xbean.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.ow2.asm</groupId>
          <artifactId>*</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.xbean</groupId>
          <artifactId>xbean-asm-util</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.apache.johnzon</groupId>
      <artifactId>johnzon-core</artifactId>
      <version>${johnzon.version}</version>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
      <version>${slf4j.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.tomee</groupId>
      <artifactId>ziplock</artifactId>
      <version>${ziplock.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>component-runtime-junit-base</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency><!-- for java >= 9 support -->
      <groupId>org.glassfish.jaxb</groupId>
      <artifactId>jaxb-runtime</artifactId>
    </dependency>
    <dependency><!-- for java >= 9 support -->
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-activation_1.1_spec</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>${dependency-plugin.version}</version>
        <executions>
          <execution>
            <id>copy-test-container-dependencies</id>
            <phase>generate-test-resources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <!-- tests jars for modules -->
              <artifactItems>
                <artifactItem>
                  <groupId>org.apache.tomee</groupId>
                  <artifactId>openejb-itests-beans</artifactId>
                  <version>${ziplock.test.version}</version>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>
                    ${project.build.directory}/test-dependencies/org/apache/tomee/openejb-itests-beans/${ziplock.test.version}
                  </outputDirectory>
                  <destFileName>openejb-itests-beans-${ziplock.test.version}.jar</destFileName>
                </artifactItem>
                <artifactItem>
                  <groupId>org.apache.tomee</groupId>
                  <artifactId>arquillian-tomee-codi-tests</artifactId>
                  <version>${ziplock.test.version}</version>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>
                    ${project.build.directory}/test-dependencies/org/apache/tomee/arquillian-tomee-codi-tests/${ziplock.test.version}
                  </outputDirectory>
                  <destFileName>arquillian-tomee-codi-tests-${ziplock.test.version}.jar</destFileName>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
          <execution>
            <id>create-TALEND-INF/dependencies.txt</id>
            <phase>process-resources</phase>
            <goals>
              <goal>list</goal>
            </goals>
            <configuration>
              <includeScope>runtime</includeScope>
              <outputFile>${project.build.outputDirectory}/TALEND-INF/manager.dependencies</outputFile>
              <excludeArtifactIds>slf4j-api</excludeArtifactIds>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <environmentVariables>
            <USER_PATH>/home/user</USER_PATH>
            <talend_localconfig_user_home>/home/user</talend_localconfig_user_home>
            <TALEND_LOCALCONFIG_TEST_0>true</TALEND_LOCALCONFIG_TEST_0>
          </environmentVariables>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
