<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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>org.yamcs</groupId>
	<artifactId>yamcs-sle</artifactId>
	<version>1.3.0</version>

	<name>Yamcs SLE</name>
	<url>https://yamcs.org</url>
	<description>
        Data links for connecting Yamcs to SLE (Space Link Extension) providers such as Ground Stations
	</description>

	<licenses>
		<license>
			<name>GNU Affero General Public License (AGPL)</name>
			<url>https://www.gnu.org/licenses/agpl-3.0.html</url>
		</license>
	</licenses>

	<scm>
		<connection>scm:git:git@github.com:yamcs/yamcs-sle.git</connection>
		<developerConnection>scm:git:ssh@github.com:yamcs/yamcs-sle.git</developerConnection>
		<url>https://github.com/yamcs/yamcs-sle</url>
		<tag>HEAD</tag>
	</scm>

	<organization>
		<name>Space Applications Services</name>
		<url>https://www.spaceapplications.com</url>
	</organization>

	<developers>
		<developer>
			<id>yamcs.org</id>
			<name>Yamcs Team</name>
		</developer>
	</developers>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<yamcsVersion>5.5.6</yamcsVersion>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.yamcs</groupId>
			<artifactId>jsle</artifactId>
			<version>0.13</version>
		</dependency>
		<dependency>
			<groupId>org.yamcs</groupId>
			<artifactId>yamcs-core</artifactId>
			<version>${yamcsVersion}</version>
		</dependency>
		<dependency>
			<groupId>org.yamcs</groupId>
			<artifactId>yamcs-web</artifactId>
			<version>${yamcsVersion}</version>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.13.1</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
			<resource>
				<directory>${project.build.directory}/generated-resources/protobuf</directory>
			</resource>
		</resources>
		<plugins>
			<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>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.1.2</version>
				<configuration>
					<archive>
						<manifestEntries>
							<Automatic-Module-Name>org.yamcs.sle</Automatic-Module-Name>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.yamcs</groupId>
				<artifactId>yamcs-maven-plugin</artifactId>
				<version>1.2.5</version>
				<executions>
					<execution>
						<goals>
							<goal>detect</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin> <!-- Sets the 'os.detected.classifier' maven property (used by protobuf-maven-plugin) -->
				<groupId>kr.motd.maven</groupId>
				<artifactId>os-maven-plugin</artifactId>
				<version>1.6.2</version>
				<executions>
					<execution>
						<phase>initialize</phase>
						<goals>
							<goal>detect</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.xolstice.maven.plugins</groupId>
				<artifactId>protobuf-maven-plugin</artifactId>
				<version>0.6.1</version>
				<executions>
					<execution>
						<goals>
							<goal>compile</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<protocArtifact>com.google.protobuf:protoc:3.7.1:exe:${os.detected.classifier}</protocArtifact>
					<writeDescriptorSet>true</writeDescriptorSet>
					<checkStaleness>true</checkStaleness>
					<descriptorSetFileName>${project.artifactId}.protobin</descriptorSetFileName>
					<descriptorSetOutputDirectory>${project.build.directory}/generated-resources/protobuf</descriptorSetOutputDirectory>
					<includeDependenciesInDescriptorSet>false</includeDependenciesInDescriptorSet>
					<includeSourceInfoInDescriptorSet>true</includeSourceInfoInDescriptorSet>
					<protocPlugins>
						<protocPlugin>
							<id>yamcs</id>
							<groupId>org.yamcs</groupId>
							<artifactId>yamcs-protoc-plugin</artifactId>
							<version>5.2.3</version>
							<mainClass>org.yamcs.protoc.ServiceGenerator</mainClass>
						</protocPlugin>
					</protocPlugins>
				</configuration>
			</plugin>
		</plugins>
	</build>

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

	<profiles>
		<profile>
			<id>java8-compatibility</id>
			<activation>
				<jdk>[9,)</jdk>
			</activation>
			<build>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-compiler-plugin</artifactId>
							<configuration>
								<release>8</release>
							</configuration>
						</plugin>
					</plugins>
				</pluginManagement>
			</build>
		</profile>
		<profile>
			<id>yamcs-release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>2.2.1</version>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<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>
							</execution>
						</executions>
					</plugin>
					<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>false</autoReleaseAfterClose>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
