<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.techempower</groupId>
	<artifactId>wildfly-ee</artifactId>
	<version>0.1</version>
	<packaging>war</packaging>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<java.version>17</java.version>
		<version.compiler.plugin>3.9.0</version.compiler.plugin>
		<version.war.plugin>3.3.2</version.war.plugin>
		<version.jakarta.ee>10.0.0</version.jakarta.ee>
		<version.wildfly-maven-plugin>5.0.1.Final</version.wildfly-maven-plugin>
		<version.wildfly.galleon.datasources.feature.pack>8.0.1.Final</version.wildfly.galleon.datasources.feature.pack>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>jakarta.platform</groupId>
				<artifactId>jakarta.jakartaee-bom</artifactId>
				<version>${version.jakarta.ee}</version>
				<scope>import</scope>
				<type>pom</type>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>jakarta.annotation</groupId>
			<artifactId>jakarta.annotation-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>jakarta.enterprise</groupId>
			<artifactId>jakarta.enterprise.cdi-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>jakarta.enterprise.concurrent</groupId>
			<artifactId>jakarta.enterprise.concurrent-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>jakarta.inject</groupId>
			<artifactId>jakarta.inject-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>jakarta.json</groupId>
			<artifactId>jakarta.json-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>jakarta.persistence</groupId>
			<artifactId>jakarta.persistence-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>jakarta.transaction</groupId>
			<artifactId>jakarta.transaction-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>jakarta.validation</groupId>
			<artifactId>jakarta.validation-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>jakarta.ws.rs</groupId>
			<artifactId>jakarta.ws.rs-api</artifactId>
			<scope>provided</scope>
		</dependency>
	</dependencies>

	<build>
		<finalName>${project.artifactId}</finalName>
		<plugins>
			<plugin>
				<artifactId>maven-war-plugin</artifactId>
				<version>${version.war.plugin}</version>
				<configuration>
					<failOnMissingWebXml>false</failOnMissingWebXml>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>${version.compiler.plugin}</version>
				<configuration>
					<release>${java.version}</release>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.wildfly.plugins</groupId>
				<artifactId>wildfly-maven-plugin</artifactId>
				<version>${version.wildfly-maven-plugin}</version>
				<configuration>
					<name>ROOT.war</name>
					<!-- Not using the version for the feature-pack and channel manifest will always use the latest -->
					<feature-packs>
						<feature-pack>
							<groupId>org.wildfly</groupId>
							<artifactId>wildfly-ee-galleon-pack</artifactId>
						</feature-pack>
						<feature-pack>
							<groupId>org.wildfly</groupId>
							<artifactId>wildfly-datasources-galleon-pack</artifactId>
							<version>${version.wildfly.galleon.datasources.feature.pack}</version>
						</feature-pack>
					</feature-packs>
					<channels>
						<channel>
							<manifest>
								<groupId>org.wildfly.channels</groupId>
								<artifactId>wildfly-ee</artifactId>
							</manifest>
						</channel>
					</channels>
					<layers>
						<layer>jaxrs-server</layer>
						<layer>jpa</layer>
						<layer>jsf</layer>
						<layer>mysql-driver</layer>
					</layers>
					<packaging-scripts>
						<packaging-script>
							<scripts>
								<script>${basedir}/scripts/wildfly-setup.cli</script>
							</scripts>
						</packaging-script>
					</packaging-scripts>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>
