<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.eclipse.basyx</groupId>
	<artifactId>basyx.components</artifactId>
	<version>1.1.0</version>
	<name>BaSyx Components</name>
	<description>BaSyx Off-the-Shelf Components</description>
	<url>https://www.eclipse.org/basyx/</url>

	<packaging>pom</packaging>

	<distributionManagement>
		<repository>
			<id>github</id>
			<name>GitHub Eclipse BaSyx Apache Maven Packages</name>
			<url>https://maven.pkg.github.com/eclipse-basyx/basyx-java-components</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
	</distributionManagement>

	<repositories>
		<repository>
			<id>central</id>
			<name>Maven Central</name>
			<layout>default</layout>
			<url>https://repo1.maven.org/maven2</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
	</repositories>

	<licenses>
		<license>
			<name>MIT</name>
			<url>https://opensource.org/licenses/MIT</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<organization>Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V.</organization>
			<id>fschnicke</id>
			<name>Frank Schnicke</name>
			<email>frank.schnicke@iese.fraunhofer.de</email>
		</developer>
	</developers>

	<scm>
		<connection>scm:https://github.com/eclipse-basyx/basyx-java-components.git</connection>
		<developerConnection>scm:https://github.com/eclipse-basyx/basyx-java-components.git</developerConnection>
		<tag>HEAD</tag>
		<url>https://github.com/eclipse-basyx/basyx-java-components</url>
	</scm>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
	</properties>

	<!-- Includes all components in this project as separated modules -->
	<modules>
		<module>basyx.components.lib</module>
		<module>basyx.components.docker</module>
	</modules>

	<build>
		<!-- Specifies plugin settings that are common for all submodules -->
		<pluginManagement>
			<plugins>
				<!-- Compile Java sources using Java 8 -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.8.1</version>
					<configuration>
						<source>1.8</source>
						<target>1.8</target>
					</configuration>
				</plugin>

				<!-- Attach sources to jar file -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>3.2.1</version>
					<executions>
						<execution>
							<id>attach-sources</id>
							<goals>
								<goal>jar-no-fork</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<!-- Generate separate jar for tests and exclude logback.xml from generated 
					jars -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>3.1.1</version>
					<configuration>
						<excludes>
							<exclude>**/logback.xml</exclude>
						</excludes>
					</configuration>
					<executions>
						<execution>
							<goals>
								<goal>test-jar</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<!-- Run unit tests (Test*.java, *Test.java, *Tests.java and *TestCase.java 
					excluding HTTP and TCP tests) -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>3.0.0-M3</version>
					<configuration>
						<excludes>
							<exclude>**/*HTTP*</exclude>
							<exclude>**/*TCP*</exclude>
						</excludes>
					</configuration>
				</plugin>

				<!-- Run integration tests (IT*.java, *IT.java and *ITCase.java) -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-failsafe-plugin</artifactId>
					<version>3.0.0-M3</version>
					<executions>
						<execution>
							<goals>
								<goal>integration-test</goal>
								<goal>verify</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>3.2.0</version>
					<configuration>
						<source>8</source>
					</configuration>
					<executions>
						<execution>
							<goals>
								<goal>javadoc</goal>
							</goals>
							<id>generate-javadoc</id>
							<phase>package</phase>
						</execution>
					</executions>
				</plugin>

				<!-- Signing the artifacts -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>1.6</version>
					<executions>
						<execution>
							<id>sign-artifacts</id>
							<phase>verify</phase>
							<goals>
								<goal>sign</goal>
							</goals>
							<configuration>
								<gpgArguments>
									<arg>--pinentry-mode</arg>
									<arg>loopback</arg>
								</gpgArguments>
							</configuration>
						</execution>
					</executions>
				</plugin>

				<!-- Upload to Maven Central -->
				<plugin>
					<groupId>org.sonatype.plugins</groupId>
					<artifactId>nexus-staging-maven-plugin</artifactId>
					<version>1.6.8</version>
					<extensions>true</extensions>
					<configuration>
						<serverId>ossrh</serverId>
						<nexusUrl>https://oss.sonatype.org/</nexusUrl>
						<autoReleaseAfterClose>true</autoReleaseAfterClose>
					</configuration>
				</plugin>

			</plugins>
		</pluginManagement>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
			</plugin>

			<!-- Attach sources to jar file -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
			</plugin>

			<!-- Generate separate jar for tests and exclude logback.xml from generated 
				jars -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
			</plugin>

			<!-- Run unit tests (Test*.java, *Test.java, *Tests.java and *TestCase.java 
				excluding HTTP and TCP tests) -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration>
					<source>8</source>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>javadoc</goal>
						</goals>
						<id>generate-javadoc</id>
						<phase>package</phase>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<!-- Every submodule depends on these dependencies -->
	<dependencies>
		<!-- JUnit 4 for running JUnit tests -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<!-- Specifies dependency settings for all submodules using these dependencies -->
	<dependencyManagement>
		<dependencies>
			<!-- BaSyx SDK -->
			<dependency>
				<groupId>org.eclipse.basyx</groupId>
				<artifactId>basyx.sdk</artifactId>
				<version>1.1.0</version>
			</dependency>

			<!-- BaSyx SDK tests -->
			<dependency>
				<groupId>org.eclipse.basyx</groupId>
				<artifactId>basyx.sdk</artifactId>
				<version>1.1.0</version>
				<classifier>tests</classifier>
				<scope>test</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<profiles>
		<profile>
			<id>MavenCentral</id>
			<distributionManagement>
				<snapshotRepository>
					<id>ossrh</id>
					<url>https://oss.sonatype.org/content/repositories/snapshots</url>
				</snapshotRepository>
				<repository>
					<id>ossrh</id>
					<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
				</repository>
			</distributionManagement>
			<build>
				<plugins>
					<!-- Upload to maven central -->
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
					</plugin>

					<!-- Signing the artifacts -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>
