<?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>org.omnifaces</groupId>
	<artifactId>vdlgen</artifactId>
	<version>1.0</version>
	<packaging>jar</packaging>

	<name>VDL Generator</name>
	<description>Facelets .taglib.xml file generator</description>
	<url>https://omnifaces.org</url>
	<organization>
		<name>OmniFaces</name>
		<url>https://omnifaces.org</url>
	</organization>
	<inceptionYear>2026</inceptionYear>

	<developers>
		<developer>
			<id>balusc</id>
			<name>Bauke Scholtz</name>
			<email>balusc@gmail.com</email>
		</developer>
	</developers>

	<licenses>
		<license>
			<name>The Apache Software License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<scm>
		<url>https://github.com/omnifaces/vdlgen</url>
		<connection>scm:git:git://github.com/omnifaces/vdlgen.git</connection>
		<developerConnection>scm:git:git@github.com:omnifaces/vdlgen.git</developerConnection>
	</scm>

    <distributionManagement>
        <snapshotRepository>
            <id>central</id>
            <url>https://central.sonatype.com/repository/maven-snapshots</url>
        </snapshotRepository>
    </distributionManagement>

	<properties>
        <javase.version>17</javase.version>
        <maven.compiler.release>${javase.version}</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
	</properties>

	<dependencies>
		<dependency>
			<groupId>jakarta.faces</groupId>
			<artifactId>jakarta.faces-api</artifactId>
			<version>4.0.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>jakarta.xml.bind</groupId>
			<artifactId>jakarta.xml.bind-api</artifactId>
			<version>4.0.2</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.persistence</groupId>
			<artifactId>org.eclipse.persistence.moxy</artifactId>
			<version>4.0.4</version>
		</dependency>
		<dependency>
			<groupId>jakarta.el</groupId>
			<artifactId>jakarta.el-api</artifactId>
			<version>5.0.0</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.google.testing.compile</groupId>
			<artifactId>compile-testing</artifactId>
			<version>0.23.0</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter</artifactId>
			<version>5.11.4</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>

            <!-- Prevent wrong JDK from being used to build the project. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.6.1</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>[${javase.version},)</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Add missing license headers to source files. -->
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>5.0.0</version>
                <executions>
                    <execution>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>format</goal>
                        </goals>
                        <configuration>
                            <licenseSets>
                                <licenseSet>
                                    <header>license.txt</header>
                                    <excludes>
                                       <exclude>*.*</exclude> <!-- excludes files in root folder -->
                                       <exclude>src/test/resources/*.*</exclude>
                                    </excludes>
                                </licenseSet>
                            </licenseSets>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

			<!-- Disable annotation processing during compilation of this project itself. -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.11.0</version>
				<configuration>
					<proc>none</proc>
				</configuration>
			</plugin>

			<!-- Configure the jar with the binaries. -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
                <version>3.4.2</version>
				<configuration>
					<archive>
						<manifest>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
							<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
						</manifest>
						<manifestEntries>
							<URL>${project.url}</URL>
							<Extension-Name>${project.artifactId}</Extension-Name>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>

			<!-- Configure the jar with the sources. -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
                <version>3.4.0</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- Configure the jar with the javadoc. -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
                <version>3.12.0</version>
				<configuration>
					<notimestamp>true</notimestamp>
					<splitindex>true</splitindex>
					<doctitle>VDL Generator API documentation</doctitle>
				</configuration>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

            <!-- Configure snapshot deployment (release deployment is done via 'release' profile). -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.1.4</version>
                <configuration>
                    <skip>false</skip>
                </configuration>
            </plugin>
		</plugins>
	</build>

	<profiles>

        <!-- Release deploy: mvn clean deploy -P release -->
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.7.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <autoPublish>true</autoPublish>
                        </configuration>
                    </plugin>

                    <!-- Signing with GPG is a requirement for a release deployment to Maven central. -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.7</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
	</profiles>

</project>