<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>de.monochromata.poms</groupId>
		<artifactId>maven-parent</artifactId>
		<version>1.1.91</version>
		<relativePath>../parent/pom.xml</relativePath>
	</parent>
	<groupId>de.monochromata.contract</groupId>
	<artifactId>java-contract-p2repo</artifactId>
	<version>15.0.36</version>
	<description>An Eclipse p2 repository for java-contract</description>
	<packaging>pom</packaging>

	<properties>
		<!-- Remove when https://gitlab.com/monochromata-de/poms/-/issues/34 is fixed -->
		<maven.compiler.source>14</maven.compiler.source>
		<maven.compiler.target>14</maven.compiler.target>
		<maven.deploy.skip>true</maven.deploy.skip>
		<maven.site.skip>true</maven.site.skip>
		<maven.site.deploy.skip>true</maven.site.deploy.skip>
		<p2repo.upload.url>sftp://ftp.monochromata.de/public_html/monochromata.de/eclipse/sites/java-contract</p2repo.upload.url>
	</properties>

	<scm>
		<developerConnection>scm:git:https://gitlab.com/monochromata-de/java-contract.git/</developerConnection>
	</scm>
	
	<build>
		<plugins>
			<!-- Generate the bundles -->
			<plugin>
				<groupId>org.reficio</groupId>
				<artifactId>p2-maven-plugin</artifactId>
				<version>1.7.0</version>
				<executions>
					<execution>
						<id>pack-artifacts-as-p2-update-site</id>
						<phase>package</phase>
						<goals>
							<goal>site</goal>
						</goals>
						<configuration>
							<pedantic>true</pedantic>
							<artifacts>
								<artifact>
									<id>de.monochromata.contract:java-contract:${project.version}</id>
									<source>true</source>
									<instructions>
										<Import-Package>*</Import-Package>
										<Export-Package>*</Export-Package>
										<Require-Capability>osgi.ee;filter:="(&amp;(osgi.ee=JavaSE)(version=${maven.compiler.target}))"</Require-Capability>
									</instructions>
								</artifact>
                                <artifact>
                                    <id>org.assertj:assertj-core:3.15.0</id>
                                    <source>true</source>
                                </artifact>
							</artifacts>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- Upload the P2 repository to monochromata.de -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>wagon-maven-plugin</artifactId>
				<version>2.0.2</version>
				<executions>
					<execution>
						<id>upload-P2</id>
						<phase>deploy</phase>
						<goals>
							<goal>upload</goal>
						</goals>
						<configuration>
							<fromDir>${project.build.directory}/repository</fromDir>
							<includes>*/**</includes>
							<serverId>ftp.monochromata.de</serverId>
							<url>${p2repo.upload.url}</url>
							<!-- <toDir></toDir> -->
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<extensions>
			<!-- Enabling the use of SFTP -->
			<extension>
				<groupId>org.apache.maven.wagon</groupId>
				<artifactId>wagon-ssh</artifactId>
				<version>3.5.0</version>
			</extension>
		</extensions>
	</build>
	
</project>
