<?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>sample-parent</artifactId>
    <version>10.57.0</version>
  </parent>

  <artifactId>sample</artifactId>

  <name>Component Runtime :: Sample Parent :: Sample</name>
  <description>A sample component. IMPORTANT: it is used by some tests.</description>

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

  <dependencies>
    <dependency>
      <!-- just to show a specific dependency usage, not that required for that sample by itself -->
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>

    <dependency>
      <!-- not for components, just for the Main sample, a real component would use scope test or not use it at all -->
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>component-runtime-manager</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>${deploy-plugin.version}</version>
        <configuration>
          <skip>true</skip>
          <!-- just a sample, we don't want to deploy it -->
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>create-TALEND-INF/dependencies.txt</id>
            <goals>
              <goal>list</goal>
            </goals>
            <phase>process-resources</phase>
            <configuration>
              <outputFile>${project.build.outputDirectory}/TALEND-INF/dependencies.txt</outputFile>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>cleanup-TALEND-INF/dependencies.txt</id>
            <!-- cleanup asap -->
            <goals>
              <goal>run</goal>
            </goals>
            <phase>compile</phase>
            <configuration>
              <target>
                <!-- TCOMP-1983 -->
                <replaceregexp byline="true" file="${project.build.outputDirectory}/TALEND-INF/dependencies.txt" match="(\u001B\[36m)?\s+--\s+module\s+.*$" replace=""/>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
