<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

    <groupId>io.zahori</groupId>
    <artifactId>zahori-process</artifactId>
    <version>0.1.2</version>
    <name>zahori-process</name>
    <description>Example of automated process using Zahori.io</description>
	<url>https://zahori.io</url>

	<organization>
		<name>PANEL SISTEMAS INFORMATICOS,S.L</name>
		<url>www.panel.es</url>
	</organization>

	<developers>
		<developer>
			<name>Zahori Panel Team</name>
			<email>eco@zahori.io</email>
			<organization>PANEL SISTEMAS INFORMATICOS,S.L</organization>
			<organizationUrl>www.panel.es</organizationUrl>
		</developer>
	</developers>

	<licenses>
		<license>
			<name>GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPL-3.0)</name>
			<url>http://opensource.org/licenses/AGPL-3.0</url>
		</license>
	</licenses>

	<inceptionYear>2021</inceptionYear>

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.4.3</version>
		<relativePath />
	</parent>
	
	<properties>
		<java.version>11</java.version>
        <spring-cloud.version>2020.0.1</spring-cloud.version>
		<start-class>io.zahori.process.ZahoriProcessApp</start-class>
		<slf4j.version>1.7.30</slf4j.version>

		<license.licenseName>agpl_v3</license.licenseName>
		<license.licenseResolver>${project.baseUri}/src/license</license.licenseResolver>
	</properties>

	<scm>
		<connection>scm:git:git://github.com/zahori-io/zahori-process.git</connection>
		<developerConnection>scm:git:git@github.com:zahori-io/zahori-process.git</developerConnection>
		<url>https://github.com/zahori-io/zahori-process.git</url>
		<tag>v0.1.2</tag>
	</scm>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
	</distributionManagement>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>io.zahori</groupId>
				<artifactId>zahori-framework</artifactId>
				<version>0.1.7</version>
			</dependency>
			<dependency>
				<groupId>io.zahori</groupId>
				<artifactId>zahori-model</artifactId>
				<version>0.1.3</version>
			</dependency>

			<dependency>
				<groupId>com.google.guava</groupId>
				<artifactId>guava</artifactId>
				<version>25.1-jre</version>
			</dependency>

			<dependency>
				<groupId>org.ow2.asm</groupId>
				<artifactId>asm</artifactId>
				<version>7.1</version>
			</dependency>

			<dependency>
				<groupId>commons-collections</groupId>
				<artifactId>commons-collections</artifactId>
				<version>3.2.2</version>
			</dependency>

			<dependency>
				<groupId>commons-logging</groupId>
				<artifactId>commons-logging</artifactId>
				<version>1.2</version>
			</dependency>

			<dependency>
				<groupId>commons-io</groupId>
				<artifactId>commons-io</artifactId>
				<version>2.8.0</version>
			</dependency>

			<dependency>
				<groupId>org.apache.commons</groupId>
				<artifactId>commons-compress</artifactId>
				<version>1.19</version>
			</dependency>

			<dependency>
				<groupId>org.antlr</groupId>
				<artifactId>antlr-runtime</artifactId>
				<version>3.5.2</version>
			</dependency>

			<dependency>
				<groupId>org.apache.xmlgraphics</groupId>
				<artifactId>xmlgraphics-commons</artifactId>
				<version>2.3</version>
			</dependency>

			<dependency>
				<groupId>com.squareup.okio</groupId>
				<artifactId>okio</artifactId>
				<version>1.17.2</version>
			</dependency>

			<dependency>
				<groupId>org.bouncycastle</groupId>
				<artifactId>bcpkix-jdk15on</artifactId>
				<version>1.58</version>
			</dependency>

			<dependency>
				<groupId>com.netflix.servo</groupId>
				<artifactId>servo-core</artifactId>
				<version>0.12.21</version>
			</dependency>

			<dependency>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-dependencies</artifactId>
				<version>${spring-cloud.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>


	<dependencies>
		<dependency>
			<groupId>io.zahori</groupId>
			<artifactId>zahori-framework</artifactId>
		</dependency>
		<dependency>
			<groupId>io.zahori</groupId>
			<artifactId>zahori-model</artifactId>
		</dependency>

		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-log4j12</artifactId>
				</exclusion>
				<exclusion>
					<groupId>ch.qos.logback</groupId>
					<artifactId>logback-classic</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-log4j12</artifactId>
				</exclusion>
				<exclusion>
					<groupId>ch.qos.logback</groupId>
					<artifactId>logback-classic</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-loadbalancer</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-devtools</artifactId>
			<scope>runtime</scope>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>jakarta.xml.bind</groupId>
			<artifactId>jakarta.xml.bind-api</artifactId>
		</dependency>

		<dependency>
			<groupId>org.glassfish.jaxb</groupId>
			<artifactId>jaxb-runtime</artifactId>
		</dependency>
	</dependencies>


	<build>
		<finalName>app</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-clean-plugin</artifactId>
				<version>3.1.0</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.0.0-M5</version>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>
				<inherited>true</inherited>
				<configuration>
					<source>${java.version}</source>
					<target>${java.version}</target>
					<encoding>${project.build.sourceEncoding}</encoding>
					<compilerArgs>
						<arg>-Xlint:unchecked</arg>
						<arg>-Xlint:deprecation</arg>
					</compilerArgs>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>versions-maven-plugin</artifactId>
				<version>2.8.1</version>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>2.5.3</version>
				<configuration>
					<autoVersionSubmodules>true</autoVersionSubmodules>
					<tagNameFormat>v@{project.version}</tagNameFormat>
					<releaseProfiles>release</releaseProfiles>
					<goals>deploy</goals>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
					<executable>true</executable>
					<finalName>app</finalName>
					<image>
						<name>docker.io/zahoriaut/${project.artifactId}:${project.version}</name>
					</image>
					<layers>
						<enabled>true</enabled>
					</layers>
					<environmentVariables>
						<DOCKER_TAG>${project.version}</DOCKER_TAG>
					</environmentVariables>
					<mainClass>${start-class}</mainClass>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>repackage</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.google.cloud.tools</groupId>
				<artifactId>jib-maven-plugin</artifactId>
				<version>2.8.0</version>
				<configuration>
					<from>
						<image>docker.io/adoptopenjdk/openjdk11:x86_64-alpine-jre-11.0.10_9</image>
					</from>
					<to>
						<image>docker.io/zahoriaut/${project.artifactId}</image>
						<credHelper>pass</credHelper>
						<tags>
							<tag>${project.version}</tag>
						</tags>
					</to>
					<container>
						<mainClass>${start-class}</mainClass>
						<ports>
							<port>9091</port>
						</ports>
						<jvmFlags>
							<jvmFlag>-Djava.security.egd=file:/dev/./urandom</jvmFlag>
						</jvmFlags>
					</container>
				</configuration>
<!--				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>build</goal>
						</goals>
					</execution>
				</executions>-->
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>enforcer</id>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-dependency-plugin</artifactId>
						<version>3.1.2</version>
						<executions>
							<execution>
								<id>analyze</id>
								<goals>
									<goal>analyze-only</goal>
								</goals>
								<configuration>
									<failOnWarning>false</failOnWarning>
									<outputXML>true</outputXML>
									<ignoreNonCompile>true</ignoreNonCompile>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-enforcer-plugin</artifactId>
						<version>3.0.0-M3</version>
						<executions>
							<execution>
								<id>enforce</id>
								<configuration>
									<rules>
										<DependencyConvergence />
										<requireMavenVersion>
											<version>3.6.3</version>
										</requireMavenVersion>
									</rules>
								</configuration>
								<goals>
									<goal>enforce</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>license-maven-plugin</artifactId>
						<version>2.0.0</version>
						<configuration>
							<verbose>false</verbose>
							<addSvnKeyWords>true</addSvnKeyWords>
						</configuration>
						<executions>
							<execution>
								<id>first</id>
								<goals>
									<goal>update-file-header</goal>
								</goals>
								<phase>process-sources</phase>
								<configuration>
									<licenseName>${license.licenseName}</licenseName>
									<roots>
										<root>src/main/java</root>
										<root>src/test</root>
									</roots>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-release-plugin</artifactId>
						<version>2.5.3</version>
						<configuration>
							<autoVersionSubmodules>true</autoVersionSubmodules>
							<useReleaseProfile>false</useReleaseProfile>
							<releaseProfiles>release</releaseProfiles>
							<goals>deploy</goals>
						</configuration>
					</plugin>

					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.8</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</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-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>3.2.0</version>
						<configuration>
							<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
						</configuration>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>1.6</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
