<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) Aros Bio AB.

    CPSign is an Open Source Software that is dual licensed to allow you to choose a license that best suits your requirements:

    1) GPLv3 (GNU General Public License Version 3) with Additional Terms, including an attribution clause as well as a limitation to use the software for commercial purposes.

    2) CPSign Proprietary License that allows you to use CPSign for commercial activities, such as in a revenue-generating operation or environment, or integrate CPSign in your proprietary software without worrying about disclosing the source code of your proprietary software, which is required if you choose to use the software under GPLv3 license. See arosbio.com/cpsign/commercial-license for details.

-->
<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>com.arosbio</groupId>
  <artifactId>encrypt-api</artifactId>
  <name>${project.groupId}:${project.artifactId}</name>
  <version>2.0.2</version>
  <packaging>jar</packaging>
  <description>The API used for encrypting resources part of the CPSign project</description>
  <url>http://arosbio.com</url>
  
  <licenses>

    <license>
      <name>GPLv3 (GNU General Public License Version 3) with Additional Terms</name>
      <comments>Non-commerical license</comments>
      <url>http://www.gnu.org/licenses/gpl-3.0.html</url>
      <distribution>repo</distribution>
    </license>

    <license>
      <name>Commercial license</name>
      <url>https://arosbio.com/cpsign/commercial-license</url>
      <distribution>repo</distribution>
    </license>

  </licenses>

  <scm>
    <connection>scm:git:git://github.com/arosbio/cpsign.git</connection>
    <developerConnection>scm:git:ssh://github.com:arosbio/cpsign.git</developerConnection>
    <url>http://github.com/arosbio/cpsign/tree/master</url>
  </scm>

  <distributionManagement>
    <repository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <developers>
    <developer>
      <name>Staffan Arvidsson McShane</name>
      <email>staffan.arvidsson@gmail.com</email>
      <organization>Pharmb.io</organization>
      <organizationUrl>https://pharmb.io/</organizationUrl>
    </developer>
  </developers>

  <properties>
    <!-- general settings -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
    <maven.compiler.release>11</maven.compiler.release>
    <!-- plugin versions -->
    <compiler.plugin.version>3.11.0</compiler.plugin.version>
    <javadoc.plugin.version>3.4.0</javadoc.plugin.version>
    <dependency.plugin.version>3.6.0</dependency.plugin.version>
    <resources.plugin.version>3.3.1</resources.plugin.version>
    <jar.plugin.version>3.3.0</jar.plugin.version>
    <surefire.plugin.version>3.0.0-M7</surefire.plugin.version>
    <exec-maven-plugin.version>3.0.0</exec-maven-plugin.version>
    <source.plugin.version>3.2.1</source.plugin.version>
    <gpg.plugin.version>3.0.1</gpg.plugin.version>
    <nexus.staging.plugin.version>1.6.7</nexus.staging.plugin.version>
  </properties>

  <dependencies>
    <!-- TEST DEPENDENCIES -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>[4.13.1,)</version>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-library</artifactId>
        <version>2.2</version>
        <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest</artifactId>
      <version>2.2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
			<resource>
				<directory>${project.basedir}/../license</directory>
				<filtering>false</filtering>
			</resource>
		</resources>

    <plugins>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>${dependency.plugin.version}</version>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${compiler.plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${javadoc.plugin.version}</version>
        <configuration>
          <author>false</author>
          <bottom><![CDATA[<i>Copyright &#169; 2022, <a href="https://arosbio.com">Aros Bio AB</a>. All Rights Reserved.</i>]]></bottom>
        </configuration>
      </plugin>
      
    </plugins>
  </build>

  <profiles>
    <!-- Profile for deploying to the maven central repo - builds and signs all required artifacts -->
    <profile>
      <id>deploy</id>
      <activation>
				<activeByDefault>false</activeByDefault>
			</activation>

      <build>
				<plugins>
          <!-- TODO - not sure if we need to specify this again -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${javadoc.plugin.version}</version>
            <configuration>
              <author>false</author>
              <bottom><![CDATA[<i>Copyright &#169; 2022, <a href="https://arosbio.com">Aros Bio AB</a>. All Rights Reserved.</i>]]></bottom>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${source.plugin.version}</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>${gpg.plugin.version}</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>${nexus.staging.plugin.version}</version>
            <extensions>true</extensions>
            <configuration>
               <serverId>ossrh</serverId>
               <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
               <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>

        </plugins>
      </build>

    </profile>
  </profiles>

</project>
