<?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>org.springframework.boot.experimental</groupId>
		<artifactId>spring-boot-thin-launcher-parent</artifactId>
		<version>1.0.2.RELEASE</version>
	</parent>

	<artifactId>spring-boot-thin-launcher</artifactId>
	<packaging>jar</packaging>

	<name>Spring Boot Thin Launcher</name>
	<description>Demo project for Spring Boot</description>

	<dependencies>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<exclusions>
				<exclusion>
					<groupId>commons-logging</groupId>
					<artifactId>commons-logging</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-loader-tools</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-loader</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-core</artifactId>
			<version>3.3.9</version>
		</dependency>
		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-embedder</artifactId>
			<version>3.3.9</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.aether</groupId>
			<artifactId>aether-transport-file</artifactId>
			<version>1.0.2.v20150114</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.aether</groupId>
			<artifactId>aether-transport-http</artifactId>
			<version>1.0.2.v20150114</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.aether</groupId>
			<artifactId>aether-connector-basic</artifactId>
			<version>1.0.2.v20150114</version>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
		</dependency>

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

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>include-layout-jar</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>copy</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>org.springframework.boot.experimental</groupId>
									<artifactId>spring-boot-thin-wrapper</artifactId>
									<version>${project.version}</version>
									<destFileName>spring-boot-thin-wrapper.jar</destFileName>
								</artifactItem>
							</artifactItems>
							<outputDirectory>${basedir}/target/generated-resources/loader/META-INF/loader</outputDirectory>
							<overWriteReleases>false</overWriteReleases>
							<overWriteSnapshots>true</overWriteSnapshots>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>add-resources</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>add-resource</goal>
						</goals>
						<configuration>
							<resources>
								<resource>
									<directory>${basedir}/target/generated-resources/loader</directory>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<configuration>
					<!-- TODO: minimize the jar (carefully) -->
					<!--minimizeJar>true</minimizeJar -->
					<keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
					<shadedClassifierName>exec</shadedClassifierName>
					<shadedArtifactAttached>true</shadedArtifactAttached>
					<transformers>
						<transformer
							implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
							<mainClass>org.springframework.boot.loader.thin.ThinJarLauncher</mainClass>
						</transformer>
						<transformer
							implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer" />
					</transformers>
					<filters>
						<filter>
							<artifact>*:*</artifact>
							<excludes>
								<exclude>META-INF/maven/**</exclude>
							</excludes>
						</filter>
					</filters>
				</configuration>
				<executions>
					<execution>
						<id>shade-runtime-dependencies</id>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<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-dependency-plugin
										</artifactId>
										<versionRange>
											[2.8,)
										</versionRange>
										<goals>
											<goal>copy</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

</project>
