<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>sg.dex</groupId>
	<artifactId>starfish-java</artifactId>
	<version>0.7.0</version>

	<name>Starfish - Developer Toolkit for data ecosystems</name>
	<url>https://github.com/DEX-company/starfish-java</url>
	<licenses>
		<license>
			<name>The Apache Software License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>
	<description>Starfish supports developing interoperable decentralised data exchange solutions,
        including use of the Ocean Protocol
    </description>

	<developers>
		<developer>
			<name>Mike Anderson</name>
			<email>mike.anderson@dex.sg</email>
			<organization>DEX</organization>
			<organizationUrl>https://www.dex.sg</organizationUrl>
		</developer>
	</developers>

	<properties>
		<gpg.keyname>340395AC</gpg.keyname>
		<gpg.useagent>true</gpg.useagent>

		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

		<junit.version>4.12</junit.version>
		<build.profile.id>dev</build.profile.id>
		<!-- Only unit tests are run by default. -->
		<skip.integration.tests>true</skip.integration.tests>
		<skip.unit.tests>false</skip.unit.tests>

		<!-- Use to avoid failures on JavaDoc errors -->
		<javadoc.opts>-Xdoclint:none</javadoc.opts>

		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
	</properties>

	<scm>
		<connection>scm:git:git@github.com:DEX-Company/${project.artifactId}.git</connection>
		<url>scm:git:git@github.com:DEX-Company/${project.artifactId}.git</url>
		<developerConnection>scm:git:git@github.com:DEX-Company/${project.artifactId}.git</developerConnection>
		<tag>starfish-java-0.7.0</tag>
	</scm>

	<repositories>
		<repository>
			<id>central</id>
			<name>Maven Central</name>
			<url>https://repo.maven.apache.org/maven2</url>
		</repository>
		<repository>
			<id>clojars.org</id>
			<name>Clojars repository</name>
			<releases>
				<enabled>true</enabled>
			</releases>
			<url>https://clojars.org/repo</url>
		</repository>
		<repository>
			<id>maven-snapshots</id>
			<url>http://oss.sonatype.org/content/repositories/snapshots</url>
			<layout>default</layout>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
	</repositories>

	<distributionManagement>
		<repository>
			<id>sonatype-nexus-staging</id>
			<name>Nexus Release Repository</name>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
		<snapshotRepository>
			<id>sonatype-nexus-snapshots</id>
			<name>Sonatype Nexus Snapshots</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
		</snapshotRepository>
	</distributionManagement>

	<dependencies>
		<dependency>
			<groupId>org.bouncycastle</groupId>
			<artifactId>bcprov-jdk15on</artifactId>
			<version>1.62</version>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.googlecode.json-simple</groupId>
			<artifactId>json-simple</artifactId>
			<version>1.1.1</version>
		</dependency>
		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
			<version>2.8.5</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.5.8</version>
		</dependency>
		<dependency>
			<groupId>com.oceanprotocol</groupId>
			<artifactId>squid</artifactId>
			<version>0.6.2</version>
			<!--<scope>test</scope> -->
			<!--<optional>true</optional> -->
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpmime</artifactId>
			<version>4.5.8</version>
		</dependency>

	</dependencies>

	<profiles>
		<profile>
			<id>all-tests</id>
			<properties>
				<build.profile.id>all-tests</build.profile.id>
				<!-- All tests are run. -->
				<skip.integration.tests>false</skip.integration.tests>
				<skip.unit.tests>false</skip.unit.tests>
			</properties>
		</profile>
		<profile>
			<id>dev</id>
		</profile>
		<profile>
			<id>integration-test</id>
			<properties>
				<!-- Used to locate the profile specific configuration file. -->
				<build.profile.id>integration-test</build.profile.id>
				<!-- Only integration tests are run. -->
				<skip.integration.tests>false</skip.integration.tests>
				<skip.unit.tests>false</skip.unit.tests>
			</properties>
		</profile>
		<!-- Activate using the release property: mvn clean install -Prelease -->
		<profile>
			<id>release</id>
			<activation>
				<property>
					<name>release</name>
				</property>
			</activation>
			<build>
				<plugins>
					<!-- To release 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>oss.sonatype.org</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</configuration>
					</plugin>

				</plugins>
			</build>
		</profile>
	</profiles>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>
				<configuration>
					<source>8</source>
					<target>8</target>
					<testSource>8</testSource>
					<testTarget>8</testTarget>
					<compilerArgument>-Xlint:deprecation</compilerArgument>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>2.5.2</version>
				<dependencies>
					<dependency>
						<groupId>org.apache.maven.shared</groupId>
						<artifactId>maven-invoker</artifactId>
						<version>2.2</version>
					</dependency>
				</dependencies>
			</plugin>

			<!-- To sign 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>
					</execution>
				</executions>
			</plugin>

			<!-- To generate javadoc -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<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>3.1.1</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<source>8</source>
					<doclint>none</doclint>
					<additionalparam>-Xdoclint:none</additionalparam>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>3.0.0</version>
				<executions>
					<!-- States that the plugin's add-test-source goal is executed at generate-test-sources 
						phase. -->
					<execution>
						<id>add-integration-test-sources</id>
						<phase>generate-test-sources</phase>
						<goals>
							<goal>add-test-source</goal>
						</goals>
						<configuration>
							<!-- Configures the source directory of integration tests. -->
							<sources>
								<source>**/*IT.java</source>
								<source>**/*Test.java</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>versions-maven-plugin</artifactId>
				<version>2.7</version>
				<configuration>
					<generateBackupPoms>false</generateBackupPoms>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<version>3.0.0-M3</version>
				<executions>
					<!-- Ensures that both integration-test and verify goals of the Failsafe 
						Maven plugin are executed. -->
					<execution>
						<id>integration-tests</id>
						<goals>
							<goal>integration-test</goal>
							<goal>verify</goal>
						</goals>
						<configuration>
							<excludes>
								<exclude>none</exclude>
							</excludes>
							<includes>
								<include>**/*IntegrationTests.java</include>
							</includes>
							<skipTests>${skip.integration.tests}</skipTests>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-site-plugin</artifactId>
				<version>3.8.2</version>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-project-info-reports-plugin</artifactId>
				<version>3.0.0</version>
			</plugin>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.8.2</version>
				<executions>
					<execution>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
					</execution>
					<!-- attached to Maven test phase -->
					<execution>
						<id>report</id>
						<phase>test</phase>
						<goals>
							<goal>report</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

</project>
