<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.github.mhoffrog</groupId>
		<artifactId>org-parent</artifactId>
		<version>1</version>
		<relativePath></relativePath>
	</parent>
	<groupId>com.github.mhoffrog.attached</groupId>
	<artifactId>attach-3rdparty-jar-parent</artifactId>
	<version>1.1</version>
	<packaging>pom</packaging>
	<build>
		<resources>
			<resource>
				<directory>${basedir}</directory>
				<filtering>false</filtering>
				<includes>
					<include>${project.artifactId}-${project.version}*.jar</include>
				</includes>
			</resource>
		</resources>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>2.8.2</version>
				</plugin>
				<plugin>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>3.0.0-M3</version>
					<executions>
						<execution>
							<id>enforce-expected-jar-file-exists</id>
							<phase>process-resources</phase>
							<goals>
								<goal>enforce</goal>
							</goals>
							<configuration>
								<rules>
									<requireFilesExist>
										<files>
											<file>${basedir}/${project.artifactId}-${project.version}.jar</file>
										</files>
									</requireFilesExist>
								</rules>
								<fail>true</fail>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<!-- Override default-jar to suppress the empty jar warning -->
				<plugin>
					<artifactId>maven-jar-plugin</artifactId>
					<version>3.2.0</version>
					<executions>
						<execution>
							<id>default-jar</id>
							<phase>package</phase>
							<configuration>
								<classesDirectory>${basedir}</classesDirectory>
								<excludes>
									<exclude>**</exclude>
								</excludes>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<!-- Override this artifacts jar with the original 3rd party jar -->
					<artifactId>maven-resources-plugin</artifactId>
					<version>3.1.0</version>
					<executions>
						<execution>
							<id>default-resources</id>
							<!-- this phase must be after phase "package" and before phase "verify" -->
							<phase>pre-integration-test</phase>
							<goals>
								<goal>resources</goal>
							</goals>
							<configuration>
								<outputDirectory>${basedir}/target</outputDirectory>
								<overwrite>true</overwrite>
							</configuration>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<profile>
			<id>fake_sources</id>
			<activation>
				<file>
					<exists>${basedir}/maven_profiles/fake_sources</exists>
				</file>
			</activation>
			<build>
				<plugins>
					<!-- attachment of sources has to be skipped -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<configuration>
							<skipSource>true</skipSource>
						</configuration>
					</plugin>
					<plugin>
						<artifactId>maven-jar-plugin</artifactId>
						<executions>
							<execution>
								<id>fake-sources-jar</id>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
								<configuration>
									<classifier>sources</classifier>
									<classesDirectory>${basedir}/..</classesDirectory>
									<includes>
										<include>README_no_Sources_no_JavaDoc.txt</include>
									</includes>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>fake_javadoc</id>
			<activation>
				<file>
					<exists>${basedir}/maven_profiles/fake_javadoc</exists>
				</file>
			</activation>
			<build>
				<plugins>
					<!-- attachment of sources has to be disabled -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<phase></phase>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-jar-plugin</artifactId>
						<executions>
							<execution>
								<id>fake-javadoc-jar</id>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
								<configuration>
									<classifier>javadoc</classifier>
									<classesDirectory>${basedir}/..</classesDirectory>
									<includes>
										<include>README_no_Sources_no_JavaDoc.txt</include>
									</includes>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>
