<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>
    <groupId>br.puc-rio.tecgraf.soma</groupId>
    <artifactId>soma-job-history-consumer</artifactId>
    <version>1.2.2</version>
    <packaging>jar</packaging>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.3.1</version>
        <relativePath />
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <main.class>br.pucrio.tecgraf.soma.job.SomaJobHistoryConsumer</main.class>
        <exec.param.registry>http://localhost:8081</exec.param.registry>
        <exec.param.server>localhost:9092</exec.param.server>
        <exec.param.status.topic>websintesi-job-events</exec.param.status.topic>
        <exec.param.progress.topic>websintesi-job-progress-events</exec.param.progress.topic>
        <exec.param.group>job-history-consumer-group</exec.param.group>
        <exec.param.hibernate>hibernate.connection.url=jdbc:postgresql://localhost:5432/jobhistory,hibernate.connection.username=jobhistory,hibernate.connection.password=password</exec.param.hibernate>
    </properties>

    <profiles>
        <profile>
            <id>tecgraf</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
		    <repositories>
		        <repository>
		            <id>confluent</id>
		            <url>https://packages.confluent.io/maven/</url>
		        </repository>
		        <repository>
		            <id>Tecgraf Releases</id>
		            <name>Tecgraf Releases</name>
		            <url>
		                http://maven.tecgraf.puc-rio.br:8081/nexus/content/repositories/releases
		            </url>
		        </repository>
		        <repository>
		            <id>Tecgraf 3rd Party</id>
		            <name>Tecgraf 3rd Party</name>
		            <url>
		                http://maven.tecgraf.puc-rio.br:8081/nexus/content/repositories/thirdparty
		            </url>
		        </repository>
		        <repository>
		            <id>Tecgraf Snapshots</id>
		            <name>Tecgraf Snapshots</name>
		            <url>
		                http://maven.tecgraf.puc-rio.br:8081/nexus/content/repositories/snapshots
		            </url>
		        </repository>
		    </repositories>
		
		    <pluginRepositories>
		        <pluginRepository>
		            <id>Tecgraf Releases</id>
		            <name>Tecgraf Releases</name>
		            <url>
		                http://maven.tecgraf.puc-rio.br:8081/nexus/content/repositories/releases
		            </url>
		        </pluginRepository>
		    </pluginRepositories>
		
		    <distributionManagement>
		        <repository>
		            <id>tecgraf-releases</id>
		            <name>Releases do Tecgraf</name>
		            <url>
		                http://maven.tecgraf.puc-rio.br:8081/nexus/content/repositories/releases
		            </url>
		        </repository>
		        <snapshotRepository>
		            <id>tecgraf-snapshots</id>
		            <name>Snapshots do Tecgraf</name>
		            <url>
		                http://maven.tecgraf.puc-rio.br:8081/nexus/content/repositories/snapshots
		            </url>
		        </snapshotRepository>
		    </distributionManagement>
        </profile>
        <profile>
            <id>petrobras</id>
            <repositories>
		        <repository>
		            <id>confluent</id>
		            <url>https://packages.confluent.io/maven/</url>
		        </repository>
                <repository>
                    <id>tic-central</id>
                    <url>http://nexus.petrobras.com.br/nexus/repository/central/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </repository>
                <repository>
                    <id>tic-thirdparty</id>
                    <url>http://nexus.petrobras.com.br/nexus/repository/thirdparty/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </repository>
                <repository>
                    <id>tic-oracle</id>
                    <url>http://nexus.petrobras.com.br/nexus/repository/oracle/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </repository>
                <repository>
                    <id>tic-scijava-org</id>
                    <url>http://nexus.petrobras.com.br/nexus/repository/maven-scijava-org/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </repository>
                <repository>
                    <id>websintesi-maven-public</id>
                    <url>http://ws-homo.petrobras.com.br:8082/repository/maven-public/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </repository>
            </repositories>
            <distributionManagement>
                <repository>
                    <id>websintesi-releases</id>
                    <name>Releases do Websintesi</name>
                    <url>
                        http://ws-homo.petrobras.com.br:8082/repository/websintesi-releases/
                    </url>
                </repository>
                <snapshotRepository>
                    <id>websintesi-snapshots</id>
                    <name>Snapshots do Websintesi</name>
                    <url>
                        http://ws-homo.petrobras.com.br:8082/repository/websintesi-snapshots/
                    </url>
                </snapshotRepository>
            </distributionManagement>
        </profile> 
    </profiles>

    <scm>
        <url>https://git.tecgraf.puc-rio.br/soma/soma-job-history-consumer</url>
        <connection>scm:git:https://git.tecgraf.puc-rio.br/soma/soma-job-history-consumer.git</connection>
        <developerConnection>scm:git:https://git.tecgraf.puc-rio.br/soma/soma-job-history-consumer.git</developerConnection>
        <tag>soma-job-history-consumer-1.2.2</tag>
    </scm>

    <dependencies>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>

        <!-- Avro -->
        <dependency>
            <groupId>org.apache.avro</groupId>
            <artifactId>avro</artifactId>
            <version>1.8.2</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Kafka -->
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-clients</artifactId>
            <version>2.0.0</version>
        </dependency>

        <!--  Kafka + Avro  -->
        <dependency>
            <groupId>io.confluent</groupId>
            <artifactId>kafka-avro-serializer</artifactId>
            <!-- For Confluent Platform 5.0.0 -->
            <version>5.0.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Schema -->
        <dependency>
            <groupId>br.puc-rio.tecgraf.soma</groupId>
            <artifactId>soma-job-history-schema</artifactId>
            <version>1.0.0</version>
        </dependency>

        <!--Apache Commons CLI-->
        <dependency>
            <groupId>commons-cli</groupId>
            <artifactId>commons-cli</artifactId>
            <version>1.8.0</version>
        </dependency>

        <!--Apache Commons Text-->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-text</artifactId>
            <version>1.12.0</version>
        </dependency>

        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
        </dependency>

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.modelmapper</groupId>
            <artifactId>modelmapper</artifactId>
            <version>3.2.0</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core-jakarta</artifactId>
            <version>5.6.15.Final</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-jersey</artifactId>
		</dependency>
		
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

		<dependency>
		    <groupId>com.google.api</groupId>
		    <artifactId>api-common</artifactId>
		    <version>2.33.0</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.annotation</groupId>
                    <artifactId>javax.annotation-api</artifactId>
                </exclusion>
            </exclusions>
		</dependency>
		
        <dependency>
            <groupId>br.puc-rio.tecgraf.soma</groupId>
            <artifactId>job-persistence</artifactId>
            <version>2.2.2</version>
        </dependency>

        <dependency>
            <groupId>br.puc-rio.tecgraf.soma</groupId>
            <artifactId>serviceAPI</artifactId>
            <version>2.0.0</version>
        </dependency>

    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>br.puc-rio.tecgraf.csbase</groupId>
                <artifactId>csbase-server-plugin</artifactId>
                <version>${csbase.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>br.puc-rio.tecgraf.csbase</groupId>
                <artifactId>csbase-common</artifactId>
                <version>${csbase.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>br.puc-rio.tecgraf.csbase</groupId>
                <artifactId>csbase-server</artifactId>
                <version>${csbase.version}</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5</version>
                <configuration>
                    <compilerArgument>-Xlint:deprecation</compilerArgument>
                    <source>17</source>
                    <target>17</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M1</version>
                <configuration>
                    <includes>
                        <include>**/*.java</include>
                    </includes>
                </configuration>
            </plugin>
			<plugin>
			    <groupId>org.apache.maven.plugins</groupId>
			    <artifactId>maven-jar-plugin</artifactId>
			    <version>3.1.0</version>
			</plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>java</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <mainClass>${main.class}</mainClass>
                    <arguments>
                        <argument>--schema-registry=${exec.param.registry}</argument>
                        <argument>--server=${exec.param.server}</argument>
                        <argument>--progress-topic=${exec.param.progress.topic}</argument>
                        <argument>--status-topic=${exec.param.status.topic}</argument>
                        <argument>--group=${exec.param.group}</argument>
                        <argument>--hibernate-config=${exec.param.hibernate}</argument>
                    </arguments>
                </configuration>
            </plugin>
            <plugin>
	            <groupId>com.spotify</groupId>
	            <artifactId>dockerfile-maven-plugin</artifactId>
	            <version>1.4.9</version>
	            <configuration>
	                <repository>${project.artifactId}</repository>
	                <tag>${project.version}</tag>
                    <buildArgs>
                        <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
                    </buildArgs>
	            </configuration>
        	</plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>
