<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (C) 2006-2025 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 https://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.87.0</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>

    <plexus-component-metadata.version>2.1.1</plexus-component-metadata.version>
    <!-- ITs -->
    <it-component-version>1.31.1</it-component-version>
    <it-component-artifact-id>jdbc</it-component-artifact-id>
    <it-component-snapshot-version>1.55.0-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>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${mvn.version}</version>
      <scope>provided</scope>
      <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>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.9.0</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>${plexus-component-metadata.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>generate-metadata</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>

  <profiles>
    <profile>
      <id>ci-build</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <property>
          <name>env.JENKINS_URL</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-invoker-plugin</artifactId>
            <configuration>
              <quiet>true</quiet>
              <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>
    </profile>
  </profiles>
</project>
