<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.8</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>

		<jdk.version>1.8</jdk.version>
		<junit.version>4.12</junit.version>

		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

		<skip.unit.tests>false</skip.unit.tests>
		<skip.integration.tests>true</skip.integration.tests>

		<javadoc.opts>-Xdoclint:none</javadoc.opts>
	</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.8</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>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.oceanprotocol</groupId>
			<artifactId>squid</artifactId>
			<version>0.6.2</version>

		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpmime</artifactId>
			<version>4.5.10</version>
		</dependency>
		<dependency>
			<groupId>org.web3j</groupId>
			<artifactId>core</artifactId>
			<version>4.5.0</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>
			<properties>
				<maven.javadoc.skip>true</maven.javadoc.skip>
			</properties>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
		</profile>
		<profile>
			<id>integration-test</id>
			<properties>
				<skip.integration.tests>false</skip.integration.tests>
				<skip.unit.tests>true</skip.unit.tests>
				<maven.javadoc.skip>true</maven.javadoc.skip>
			</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>

					<!-- 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>

					<!-- 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>
				</plugins>
			</build>
		</profile>
	</profiles>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.5</version>
				<configuration>
					<source>${jdk.version}</source>
					<target>${jdk.version}</target>
					<encoding>${project.build.sourceEncoding}</encoding>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>2.5.2</version>
				<configuration>
					<!-- During release:perform, enable the "release" profile -->
					<releaseProfiles>release</releaseProfiles>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>org.apache.maven.shared</groupId>
						<artifactId>maven-invoker</artifactId>
						<version>2.2</version>
					</dependency>
				</dependencies>
			</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>1.12</version>
				<executions>
					<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 our integration tests -->
							<sources>
								<source>src/integration-test/java</source>
							</sources>
						</configuration>
					</execution>
					<!-- Add a new resource directory to our build -->
					<execution>
						<id>add-integration-test-resources</id>
						<phase>generate-test-resources</phase>
						<goals>
							<goal>add-test-resource</goal>
						</goals>
						<configuration>
							<!-- Configures the resource directory of our integration tests -->
							<resources>
								<resource>
									<filtering>true</filtering>
									<directory>src/integration-test/resources</directory>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.19.1</version>
				<configuration>
					<skipTests>${skip.unit.tests}</skipTests>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<version>2.19.1</version>
				<executions>
					<execution>
						<id>integration-tests</id>
						<goals>
							<goal>integration-test</goal>
							<goal>verify</goal>
						</goals>
						<configuration>
							<includes>
								<include>**/*.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>
