<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed under the European Space Agency Public License, Version 2.0
    You may not use this file except in compliance with the License.

    Except as expressly set forth in this License, the Software is provided to
    You on an "as is" basis and without warranties of any kind, including without
    limitation merchantability, fitness for a particular purpose, absence of
    defects or errors, accuracy or non-infringement of intellectual property rights.
 
    See the License for the specific language governing permissions and limitations under the License.
-->
<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>int.esa.opssat</groupId>
  <version>1.2.0</version>
  <artifactId>spacecraft-simulator</artifactId>
  <packaging>jar</packaging>
  <name>ESA OPS-SAT - Spacecraft Simulator</name>
  <description>A simple software simulator of OPS-SAT</description>
  <url>http://www.esa.int</url>
  <properties>
    <orekit.apache-commons-math.version>3.6.1</orekit.apache-commons-math.version>
  </properties>
  <organization>
    <name>ESA</name>
    <url>http://www.esa.int</url>
  </organization>
  <licenses>
    <license>
      <name>The European Space Agency Public License, Version 2.0</name>
      <url>https://raw.github.com/esa/CCSDS_APPS/master/LICENCE.md</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:git@github.com:esa/NMF_MISSION_SOFTWARE_SIMULATOR.git</connection>
    <developerConnection>scm:git:git@github.com:esa/NMF_MISSION_SOFTWARE_SIMULATOR.git</developerConnection>
    <url>https://github.com/esa/NMF_MISSION_SOFTWARE_SIMULATOR</url>
  </scm>
  <developers>
    <developer>
      <id>CezarSuteu</id>
      <name>Cezar Suteu</name>
      <email>Cezar.Suteu@esa.int</email>
      <url>https://github.com/CezarSuteu</url>
    </developer>
    <developer>
      <id>CesarCoelho</id>
      <name>César Coelho</name>
      <email>Cesar.Coelho@esa.int</email>
      <url>https://github.com/CesarCoelho</url>
    </developer>
  </developers>
  <distributionManagement>
    <site>
      <id>Sonatype</id>
      <url>https://oss.sonatype.org/</url>
    </site>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>
  <dependencies>
    <dependency>
      <groupId>int.esa.opssat</groupId>
      <artifactId>gps-simulator</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.orekit</groupId>
      <artifactId>orekit</artifactId>
      <version>7.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-math3</artifactId>
      <version>${orekit.apache-commons-math.version}</version>
      <type>jar</type>
      <optional>false</optional>
    </dependency>
  </dependencies>
  <build>
    <resources>
      <resource>
        <directory>${basedir}/..</directory>
        <includes>
          <include>LICENCE.md</include>
        </includes>
      </resource>
      <resource>
        <directory>${basedir}/src/main/resources</directory>
        <includes>
          <include>earth.jpg</include>
        </includes>
      </resource>
      <resource>
        <directory>${basedir}/src/main/resources</directory>
        <includes>
          <include>ESA-logo.png</include>
        </includes>
      </resource>
      <resource>
        <directory>${basedir}/src/main/resources</directory>
        <includes>
          <include>03_logo_dark_blue.bmp</include>
        </includes>
      </resource>
      <resource>
        <directory>${basedir}/ops-sat-simulator-resources</directory>
        <includes>
          <include>**</include>
        </includes>
      </resource>
      <resource>
        <directory>${basedir}/src/main/resources</directory>
        <includes>
          <include>descriptions.txt</include>
        </includes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.4.1</version>
        <executions>
          <execution>
            <id>enforce</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <DependencyConvergence />
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.10</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.12</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.6.0</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.0.2</version>
      </plugin>
      <plugin>
        <!-- Disable Maven Deploy and use Nexus Staging plugin instead -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.8.2</version>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>assembly-with-dependencies</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>3.0.0</version>
            <configuration>
              <descriptorRefs>
                <descriptorRef>jar-with-dependencies</descriptorRef>
              </descriptorRefs>
              <finalName>${project.artifactId}</finalName>
            </configuration>
            <executions>
              <execution>
                <id>make-assembly</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.0.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-javadoc-plugin</artifactId>
            <version>2.10.4</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</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>
            <executions>
              <execution>
                <id>default-deploy</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>false</autoReleaseAfterClose>
            </configuration>
          </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>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
