<?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>

	<parent>
		<groupId>com.top-logic</groupId>
		<artifactId>tl-parent-all</artifactId>
		<version>7.10.2</version>
		<relativePath>..</relativePath>
	</parent>
	
	<artifactId>tl-maven-plugin</artifactId>
	
	<name>TopLogic Maven Plugin</name>
	<description>
		Maven plugin that provides goals for working with the TopLogic application engine. Besides others, a goal is 
		provided that builds a runnable application WAR out of multiple stacked application layers. The final 
		application WAR is composed of all artifacts classified as 'web-fragment' with all 'jar' dependencies of 
		the application module in WEB-INF/lib. During the WAR generation, stacked resources such as layout XML and
		metaConf.txt of dependent modules are composed from their modular version to a single deployable monolithic 
		resource.  
	</description>
	<url>https://github.com/top-logic/tl-engine/</url>
	
	<organization>
		<name>Business Operation Systems GmbH</name>
		<url>https://www.top-logic.com</url>
	</organization>
	
	<packaging>maven-plugin</packaging>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.javadoc.skip>true</maven.javadoc.skip>

		<!-- Maven has internal duplications in its utilities. -->		
		<skipDependencyCheck>true</skipDependencyCheck>
		<dependency-check.skip>true</dependency-check.skip>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-plugin-api</artifactId>
			<version>3.9.14</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-core</artifactId>
			<version>3.9.14</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-artifact</artifactId>
			<version>3.9.14</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-model</artifactId>
			<version>3.9.14</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-builder-support</artifactId>
			<version>3.9.14</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-model-builder</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-compat</artifactId>
			<version>3.9.14</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.maven.plugin-tools</groupId>
			<artifactId>maven-plugin-annotations</artifactId>
			<version>3.15.2</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.13.2</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.maven.plugin-testing</groupId>
			<artifactId>maven-plugin-testing-harness</artifactId>
			<version>3.5.1</version>
			<scope>test</scope>
		</dependency>

		<dependency>
		    <groupId>com.google.code.gson</groupId>
		    <artifactId>gson</artifactId>
		    <version>2.13.2</version>
		</dependency>
		
		<dependency>
		    <groupId>com.top-logic</groupId>
		    <artifactId>tl-basic-core</artifactId>
		</dependency>
		<dependency>
		    <groupId>org.apache.maven.shared</groupId>
		    <artifactId>maven-artifact-transfer</artifactId>
		    <version>0.13.1</version>
		</dependency>
		<dependency>
		    <groupId>org.apache.maven.shared</groupId>
		    <artifactId>maven-invoker</artifactId>
		    <version>3.3.0</version>
		</dependency>
		
		<!-- Note: Newer versions have an issue with excessive memory consumption causing builds to fail when creating larger WAR artifacts. -->
		<!-- The issue declared to be fixed, but can still be observed: https://issues.apache.org/jira/browse/MSOURCES-94 -->
		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-archiver</artifactId>
			<version>3.6.6</version>
		</dependency>

		<dependency>
			<groupId>org.codehaus.plexus</groupId>
			<artifactId>plexus-archiver</artifactId>
			<version>4.11.0</version>
		</dependency>
		<dependency>
			<groupId>org.codehaus.plexus</groupId>
			<artifactId>plexus-utils</artifactId>
			<version>4.0.3</version>
		</dependency>
		<dependency>
		    <groupId>com.github.javaparser</groupId>
		    <artifactId>javaparser-core</artifactId>
		    <version>3.28.0</version>
		</dependency>
		<dependency>
		    <groupId>org.ow2.asm</groupId>
		    <artifactId>asm</artifactId>
		    <version>9.9.1</version>
		</dependency>
		<dependency>
		    <groupId>com.top-logic</groupId>
		    <artifactId>tl-tools-resources</artifactId>
		</dependency>
	</dependencies>

	<build>
		<!-- lock down plugins versions to avoid using Maven defaults (may be moved 
			to parent pom) -->
		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings 
					only. It has no influence on the Maven build itself. -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.apache.maven.plugins</groupId>
										<artifactId>maven-plugin-plugin</artifactId>
										<versionRange>[3.6.0,)</versionRange>
										<goals>
											<goal>descriptor</goal>
											<goal>helpmojo</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-plugin-plugin</artifactId>
				<configuration>
					<!-- <goalPrefix>maven-archetype-plugin</goalPrefix> -->
					<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
				</configuration>
				<executions>
					<execution>
						<id>mojo-descriptor</id>
						<goals>
							<goal>descriptor</goal>
						</goals>
					</execution>
					<execution>
						<id>help-goal</id>
						<goals>
							<goal>helpmojo</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<!-- Allow debugging test cases. -->
					<forkCount>0</forkCount>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration>
					<!-- Skip javadoc here to ensure overriding eventually set system property. -->
					<skip>true</skip>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>run-its</id>
			<build>

				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-invoker-plugin</artifactId>
						<configuration>
							<debug>true</debug>
							<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
							<pomIncludes>
								<pomInclude>*/pom.xml</pomInclude>
							</pomIncludes>
							<postBuildHookScript>verify</postBuildHookScript>
							<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
							<settingsFile>src/it/settings.xml</settingsFile>
							<goals>
								<goal>clean</goal>
								<goal>test-compile</goal>
							</goals>
						</configuration>
						<executions>
							<execution>
								<id>integration-test</id>
								<goals>
									<goal>install</goal>
									<goal>integration-test</goal>
									<goal>verify</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
