<?xml version="1.0" encoding="UTF-8"?>
<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">
	<parent>
		<artifactId>talend-bigdata-launcher</artifactId>
		<groupId>org.talend.bigdata.libs</groupId>
		<version>2.16.8</version>
		<relativePath>../pom.xml</relativePath>
	</parent>
	<modelVersion>4.0.0</modelVersion>

	<artifactId>talend-bigdata-launcher-databricks</artifactId>
	<packaging>jar</packaging>

	<dependencies>
		<dependency>
			<groupId>org.talend.bigdata.libs</groupId>
			<artifactId>talend-bigdata-launcher-core</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>com.databricks</groupId>
			<artifactId>databricks-sdk-java</artifactId>
		</dependency>
		<dependency>
			<groupId>org.assertj</groupId>
			<artifactId>assertj-core</artifactId>
			<version>3.25.3</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>net.bytebuddy</groupId>
			<artifactId>byte-buddy</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>net.bytebuddy</groupId>
			<artifactId>byte-buddy-agent</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-all</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
	    <plugins>
	        <!-- Despite the "sources" classifier name, Studio depends on this jar
	             at runtime as a regular (compiled) dependency, not as an IDE
	             attach-sources artifact - see review discussion on QTBD-3424:
	             https://github.com/Talend/bigdata-launcher/pull/157#discussion_r4047032020.
	             Keep building it with maven-jar-plugin (compiled classes), not
	             maven-source-plugin (real .java sources). -->
	        <plugin>
	            <groupId>org.apache.maven.plugins</groupId>
	            <artifactId>maven-jar-plugin</artifactId>
	            <executions>
	                <execution>
	                    <id>sources-jar</id>
	                    <goals>
	                        <goal>jar</goal>
	                    </goals>
	                    <configuration>
	                        <classifier>sources</classifier>
	                    </configuration>
	                </execution>
	            </executions>
	        </plugin>

	        <!-- Studio's org.talend.designer.components.sparkprovider plugin.xml
	             resolves this jar as a standalone artifact
	             (org.talend.bigdata.libs:talend-bigdata-launcher-databricks-sources),
	             not as the "sources" classifier of talend-bigdata-launcher-databricks.
	             Publish the same (compiled-classes) jar under that extra coordinate
	             too so the release matches what Studio actually requests. See
	             QTBD-3424. -->
	        <plugin>
	            <groupId>org.apache.maven.plugins</groupId>
	            <artifactId>maven-deploy-plugin</artifactId>
	            <executions>
	                <execution>
	                    <id>deploy-sources-as-standalone-artifact</id>
	                    <phase>deploy</phase>
	                    <goals>
	                        <goal>deploy-file</goal>
	                    </goals>
	                    <configuration>
	                        <file>${project.build.directory}/${project.build.finalName}-sources.jar</file>
	                        <groupId>${project.groupId}</groupId>
	                        <artifactId>talend-bigdata-launcher-databricks-sources</artifactId>
	                        <version>${project.version}</version>
	                        <packaging>jar</packaging>
	                        <generatePom>true</generatePom>
	                        <url>${project.distributionManagement.repository.url}</url>
	                        <repositoryId>${project.distributionManagement.repository.id}</repositoryId>
	                    </configuration>
	                </execution>
	            </executions>
	        </plugin>

	        <plugin>
	            <groupId>org.apache.maven.plugins</groupId>
	            <artifactId>maven-shade-plugin</artifactId>
	            <executions>
	                <execution>
	                    <phase>package</phase>
	                    <goals>
	                        <goal>shade</goal>
	                    </goals>
	                    <configuration>
	                        <shadedClassifierName></shadedClassifierName>
	                        <artifactSet>
	                            <excludes>
	                                <exclude>log4j:log4j:jar:</exclude>
	                                <exclude>commons-logging:commons-logging:jar:</exclude>
	                            </excludes>
	                        </artifactSet>
	                        <relocations>
	                            <relocation>
	                                <pattern>org.apache.http</pattern>
	                                <shadedPattern>org.talend.bigdata.http</shadedPattern>
	                            </relocation>
	                            <relocation>
	                                <pattern>com.fasterxml.jackson</pattern>
	                                <shadedPattern>org.talend.bigdata.jackson</shadedPattern>
	                            </relocation>
	                            <relocation>
	                                <pattern>org.apache.commons.lang3</pattern>
	                                <shadedPattern>org.talend.bigdata.lang3</shadedPattern>
	                            </relocation>
	                            <relocation>
	                                <pattern>org.apache.commons.codec</pattern>
	                                <shadedPattern>org.talend.bigdata.codec</shadedPattern>
	                            </relocation>
	                            <relocation>
	                                <pattern>org.apache.commons.io</pattern>
	                                <shadedPattern>org.talend.bigdata.io</shadedPattern>
	                            </relocation>
	                            <relocation>
	                                <pattern>com.google</pattern>
	                                <shadedPattern>org.talend.bigdata.google</shadedPattern>
	                            </relocation>
	                            <relocation>
	                                <pattern>google.protobuf</pattern>
	                                <shadedPattern>org.talend.bigdata.google.protobuf</shadedPattern>
	                            </relocation>
	                            <relocation>
	                                <pattern>javax.annotation</pattern>
	                                <shadedPattern>org.talend.bigdata.javax.annotation</shadedPattern>
	                            </relocation>
	                            <relocation>
	                                <pattern>mozilla</pattern>
	                                <shadedPattern>org.talend.bigdata.mozilla</shadedPattern>
	                            </relocation>
	                        </relocations>
	                        <transformers>
	                            <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
	                            <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer"/>
	                        </transformers>
	                    </configuration>
	                </execution>
	            </executions>
	        </plugin>

	        <plugin>
	            <groupId>org.codehaus.mojo</groupId>
	            <artifactId>build-helper-maven-plugin</artifactId>
	        </plugin>
	        <plugin>
	            <groupId>org.jacoco</groupId>
	            <artifactId>jacoco-maven-plugin</artifactId>
	        </plugin>
	        <plugin>
	            <groupId>org.apache.maven.plugins</groupId>
	            <artifactId>maven-failsafe-plugin</artifactId>
	        </plugin>
	    </plugins>
	</build>
</project>
