<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</artifactId>
	<version>2.3.0</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>
		<exec.param.hibernate>
			hibernate.connection.url=jdbc:postgresql://localhost:5432/jobhistory,hibernate.connection.username=jobhistory,hibernate.connection.password=password
		</exec.param.hibernate>
		<exec.param.server>
			http://localhost:8010/v2/
		</exec.param.server>
		<start-class>br.pucrio.tecgraf.soma.job.SomaJobHistoryService</start-class>
	</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>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</url>
		<connection>scm:git:https://git.tecgraf.puc-rio.br/soma/soma-job-history.git</connection>
		<developerConnection>scm:git:https://git.tecgraf.puc-rio.br/soma/soma-job-history.git</developerConnection>
		<tag>soma-job-history-2.3.0</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>
		<dependency>
			<groupId>org.junit.vintage</groupId>
			<artifactId>junit-vintage-engine</artifactId>
			<scope>test</scope>
			<exclusions>
				<exclusion>
					<groupId>org.hamcrest</groupId>
					<artifactId>hamcrest-core</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.postgresql</groupId>
			<artifactId>postgresql</artifactId>
		</dependency>
		<dependency>
			<groupId>br.puc-rio.tecgraf.soma</groupId>
			<artifactId>serviceAPI</artifactId>
			<version>2.0.0</version>
		</dependency>
		<dependency>
			<groupId>br.puc-rio.tecgraf.soma</groupId>
			<artifactId>job-persistence</artifactId>
			<version>2.2.0</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jpa</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.hibernate.orm</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-test</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-text</artifactId>
			<version>1.6</version>
		</dependency>
		<dependency>
			<groupId>io.swagger.core.v3</groupId>
			<artifactId>swagger-jaxrs2-jakarta</artifactId>
			<version>2.2.22</version>
		</dependency>
		<dependency>
			<groupId>io.swagger</groupId>
			<artifactId>swagger-jersey2-jaxrs</artifactId>
			<version>1.6.13</version>
		</dependency>
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-core-jakarta</artifactId>
			<version>5.6.15.Final</version>
		</dependency>
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-jcache</artifactId>
			<version>5.6.15.Final</version>
		</dependency>
		<dependency>
			<groupId>org.ehcache</groupId>
			<artifactId>ehcache</artifactId>
			<classifier>jakarta</classifier>
		</dependency>
		<dependency>
			<groupId>org.modelmapper</groupId>
			<artifactId>modelmapper</artifactId>
			<version>3.2.0</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator</artifactId>
		</dependency>
		<dependency>
			<groupId>jakarta.ws.rs</groupId>
			<artifactId>jakarta.ws.rs-api</artifactId>
			<version>3.1.0</version>
		</dependency>
		<dependency>
			<groupId>jakarta.servlet</groupId>
			<artifactId>jakarta.servlet-api</artifactId>
			<version>6.0.0</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents.client5</groupId>
			<artifactId>httpclient5</artifactId>
			<version>5.3.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>jakarta.validation</groupId>
			<artifactId>jakarta.validation-api</artifactId>
			<version>3.0.2</version>
		</dependency>
		<dependency>
			<groupId>jakarta.xml.bind</groupId>
			<artifactId>jakarta.xml.bind-api</artifactId>
			<version>4.0.2</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jaxb</groupId>
			<artifactId>jaxb-runtime</artifactId>
			<version>4.0.5</version>
		</dependency>
		<!-- Metricas -->
		<dependency>
			<groupId>io.micrometer</groupId>
			<artifactId>micrometer-registry-prometheus</artifactId>
		</dependency>
		<!-- Geração de logs com logback e o encoder em formato logstash -->
		<dependency>
			<groupId>com.internetitem</groupId>
			<artifactId>logback-elasticsearch-appender</artifactId>
			<version>1.6</version>
		</dependency>
		<dependency>
			<groupId>net.logstash.logback</groupId>
			<artifactId>logstash-logback-encoder</artifactId>
			<version>7.4</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>2.5.3</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.1.0</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.6.2</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>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.0.0-M5</version>
				<configuration>
					<includes>
						<include>**/*.java</include>
					</includes>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.openapitools</groupId>
				<artifactId>openapi-generator-maven-plugin</artifactId>
				<version>7.10.0</version>
				<executions>
					<execution>
						<goals>
							<goal>generate</goal>
						</goals>
						<configuration>
							<verbose>false</verbose>
							<inputSpec>${project.basedir}/src/main/resources/search-api.yaml</inputSpec>
							<generatorName>jaxrs-jersey</generatorName>
							<modelPackage>br.pucrio.tecgraf.soma.job.api.model</modelPackage>
							<apiPackage>br.pucrio.tecgraf.soma.job.api</apiPackage>
							<configOptions>
								<sourceFolder>src/main/java</sourceFolder>
								<useJakartaEe>true</useJakartaEe>
								<library>jersey2</library>
								<additionalModelTypeAnnotations>
									@com.fasterxml.jackson.annotation.JsonInclude(value=com.fasterxml.jackson.annotation.JsonInclude.Include.CUSTOM,valueFilter=br.pucrio.tecgraf.soma.job.application.JsonUndefined.class)</additionalModelTypeAnnotations>
							</configOptions>
							<environmentVariables>
								<!-- generate all models -->
								<models />
								<!-- generate all APIs -->
								<apis />
								<supportingFiles>
									ApiException.java,NotFoundException.java,ApiResponseMessage.java
								</supportingFiles>
							</environmentVariables>
						</configuration>
					</execution>
				</executions>
			</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>${start-class}</mainClass>
					<arguments>
						<argument>--hibernate-config=${exec.param.hibernate}</argument>
						<argument>--server-base-url=${exec.param.server}</argument>
					</arguments>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
</project>