<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (C) 2006-2023 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.54.1</version>
  </parent>

  <artifactId>talend-component-maven-plugin</artifactId>
  <packaging>maven-plugin</packaging>

  <name>Component Runtime :: Maven Plugin</name>
  <description>Provides Talend Component Kit Tools wrapped as Maven Mojos.</description>

  <properties>
    <invoker.streamLogs>true</invoker.streamLogs>

    <talend.build.name>${talend.build.name.base}.maven</talend.build.name>

    <!-- ITs -->
    <it-component-version>1.31.1</it-component-version>
    <it-component-artifact-id>jdbc</it-component-artifact-id>
    <it-component-snapshot-version>1.31.2-SNAPSHOT</it-component-snapshot-version>
    <it-component-snapshot-artifact-id>salesforce</it-component-snapshot-artifact-id>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>component-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>component-tools</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <!-- extends runtime manager with design time data -->
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>component-runtime-design-extension</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>${mvn-minimal.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${mvn.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${mvn.version}</version>
      <exclusions>
        <exclusion>
          <groupId>com.google.guava</groupId>
          <artifactId>guava</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.maven.shared</groupId>
          <artifactId>maven-shared-utils</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-shared-utils</artifactId>
      <version>${maven-shared-utils.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-jsonb_1.0_spec</artifactId>
      <version>${geronimo-jsonb.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-json_1.1_spec</artifactId>
      <version>${geronimo-json.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.johnzon</groupId>
      <artifactId>johnzon-jsonb</artifactId>
    </dependency>

    <dependency>
      <groupId>com.github.spullara.mustache.java</groupId>
      <artifactId>compiler</artifactId>
      <version>0.9.6</version>
    </dependency>

    <dependency>
      <groupId>org.eclipse.jgit</groupId>
      <artifactId>org.eclipse.jgit</artifactId>
      <version>${jgit.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-jdk14</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>com.google.cloud.tools</groupId>
      <artifactId>jib-core</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.xbean</groupId>
      <artifactId>xbean-finder-shaded</artifactId>
      <version>${xbean.version}</version>
    </dependency>

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

    <dependency>
      <groupId>javax.activation</groupId>
      <artifactId>activation</artifactId>
      <version>1.1.1</version>
    </dependency>

    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>component-runtime-di</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.5.2</version>
        <configuration>
          <goalPrefix>talend-component</goalPrefix>
          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
        </configuration>
        <executions>
          <execution>
            <id>mojo-descriptor</id>
            <goals>
              <goal>descriptor</goal>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-component-metadata</artifactId>
        <version>1.7.1</version>
        <executions>
          <execution>
            <goals>
              <goal>generate-metadata</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <configuration>
          <showErrors>true</showErrors>
          <projectsDirectory>src/it</projectsDirectory>
          <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
          <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
          <settingsFile>src/it/settings.xml</settingsFile>
          <scriptVariables>
            <componentVersion>${it-component-version}</componentVersion>
            <componentArtifactId>${it-component-artifact-id}</componentArtifactId>
            <componentSnapshotVersion>${it-component-snapshot-version}</componentSnapshotVersion>
            <componentSnapshotArtifactId>${it-component-snapshot-artifact-id}</componentSnapshotArtifactId>
          </scriptVariables>
          <postBuildHookScript>postbuild.groovy</postBuildHookScript>
          <pomIncludes>
            <pomInclude>*/pom.xml</pomInclude>
          </pomIncludes>
          <goals>
            <goal>clean</goal>
            <goal>verify</goal>
          </goals>
        </configuration>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>install</goal>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.5.2</version>
      </plugin>
    </plugins>
  </reporting>
</project>
