<?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>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.4.6</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>
	<groupId>com.manydesigns</groupId>
	<artifactId>portofino-spring-boot</artifactId>
	<version>5.3.2</version>
	<name>portofino-spring-boot</name>
	<description>Launch Portofino as a Spring Boot application</description>
	<properties>
		<java.version>1.8</java.version>
	</properties>
	<distributionManagement>
		<snapshotRepository>
			<id>sonatype-nexus-snapshots</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
	</distributionManagement>
	<dependencies>
		<dependency>
			<groupId>com.manydesigns</groupId>
			<artifactId>portofino-core</artifactId>
			<version>${project.version}</version>
		</dependency>
		<!-- Groovy is optional -->
		<dependency>
			<groupId>org.codehaus.groovy</groupId>
			<artifactId>groovy</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.manydesigns</groupId>
			<artifactId>portofino-jersey</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>com.manydesigns</groupId>
			<artifactId>portofino-resteasy</artifactId>
			<version>${project.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<!-- JAXB for Java 11+ -->
		<dependency>
			<groupId>jakarta.xml.bind</groupId>
			<artifactId>jakarta.xml.bind-api</artifactId>
		</dependency>
		<dependency>
			<groupId>jakarta.annotation</groupId>
			<artifactId>jakarta.annotation-api</artifactId>
		</dependency>
		<dependency>
			<groupId>jakarta.activation</groupId>
			<artifactId>jakarta.activation-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jaxb</groupId>
			<artifactId>jaxb-runtime</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<configuration>
					<mavenExecutorId>forked-path</mavenExecutorId>
					<useReleaseProfile>false</useReleaseProfile>
					<arguments>-Psonatype-oss-release</arguments>
					<localCheckout>true</localCheckout>
					<pushChanges>false</pushChanges>
					<tagNameFormat>@{project.version}</tagNameFormat>
					<autoVersionSubmodules>true</autoVersionSubmodules>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
					<mainClass>com.manydesigns.portofino.microservices.boot.PortofinoBootApplication</mainClass>
					<classifier>standalone</classifier>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>repackage</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>portofino-release</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.8</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>sonatype-nexus-snapshots</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
							<skipStagingRepositoryClose>true</skipStagingRepositoryClose>
							<autoReleaseAfterClose>false</autoReleaseAfterClose>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>3.1.1</version>
						<configuration>
							<verbose>true</verbose>
							<!-- workaround for https://bugs.openjdk.java.net/browse/JDK-8212233 -->
							<source>8</source>
							<links>
								<link>https://commons.apache.org/proper/commons-configuration/apidocs/</link>
								<link>https://docs.jboss.org/hibernate/orm/5.4/javadocs/</link>
								<link>https://docs.groovy-lang.org/docs/groovy-${groovy.version}/html/gapi/</link>
								<link>https://www.joda.org/joda-time/apidocs/</link>
								<link>https://docs.oracle.com/javaee/7/api/</link>
								<link>https://docs.oracle.com/javase/8/docs/api/</link>
							</links>
						</configuration>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<phase>verify</phase>
								<goals>
									<goal>jar</goal>
									<goal>aggregate-jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>3.2.1</version>
						<executions>
							<execution>
								<id>attach-sources</id>
								<phase>verify</phase>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>1.6</version>
						<executions>
							<execution>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
								<configuration>
									<keyname>info@manydesigns.com</keyname>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-enforcer-plugin</artifactId>
						<version>1.4.1</version>
						<executions>
							<execution>
								<id>enforce-bytecode-version</id>
								<goals>
									<goal>enforce</goal>
								</goals>
								<configuration>
									<rules>
										<enforceBytecodeVersion>
											<maxJdkVersion>1.8</maxJdkVersion>
										</enforceBytecodeVersion>
										<!--<dependencyConvergence/>-->
									</rules>
									<fail>true</fail>
								</configuration>
							</execution>
						</executions>
						<dependencies>
							<dependency>
								<groupId>org.codehaus.mojo</groupId>
								<artifactId>extra-enforcer-rules</artifactId>
								<version>1.2</version>
							</dependency>
						</dependencies>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>
