<?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>
	<artifactId>spring-boot-springdoc</artifactId>
	<version>3.1.2</version>
	<name>spring-boot-springdoc</name>
	<description>Project for Springdoc integration</description>
	<packaging>jar</packaging>

	<parent>
		<groupId>org.springdoc</groupId>
		<artifactId>springdoc-openapi-demos</artifactId>
		<version>3.1.2</version>
	</parent>

	<properties>
		<java.version>1.8</java.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- SpringDoc -->
		<dependency>
			<groupId>org.springdoc</groupId>
			<artifactId>springdoc-openapi-ui</artifactId>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>integration</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.springframework.boot</groupId>
						<artifactId>spring-boot-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>pre-integration-test</id>
								<goals>
									<goal>start</goal>
								</goals>
							</execution>
							<execution>
								<id>post-integration-test</id>
								<goals>
									<goal>stop</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.springdoc</groupId>
						<artifactId>springdoc-openapi-maven-plugin</artifactId>
						<version>0.2</version>
						<executions>
							<execution>
								<phase>integration-test</phase>
								<goals>
									<goal>generate</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<apiDocsUrl>http://localhost:8080/api-docs</apiDocsUrl>
							<outputFileName>openapi.json</outputFileName>
							<outputDir>${project.build.directory}</outputDir>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>


</project>