<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright © 2017-2021 Dominic Heutelbeck (dominic@heutelbeck.com) Licensed 
	under the Apache License, Version 2.0 (the "License"); you may not use this 
	file except in compliance with the License. You may obtain a copy of the 
	License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by 
	applicable law or agreed to in writing, software distributed under the License 
	is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
	KIND, either express or implied. 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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>io.sapl</groupId>
		<artifactId>sapl-policy-engine</artifactId>
		<version>2.0.0</version>
		<relativePath />
	</parent>

	<artifactId>sapl-ethereum</artifactId>

	<name>SAPL Ethereum</name>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>io.sapl</groupId>
				<artifactId>sapl-bom</artifactId>
				<version>${project.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>


	<organization>
		<name>Dominic Heutelbeck</name>
	</organization>

	<dependencies>
		<dependency>
			<groupId>io.sapl</groupId>
			<artifactId>sapl-extensions-api</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.web3j</groupId>
			<artifactId>core</artifactId>
			<version>4.5.11</version>
		</dependency>

		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-nop</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>io.projectreactor</groupId>
			<artifactId>reactor-test</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>sapl-pdp-embedded</artifactId>
			<version>${project.version}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-junit-jupiter</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-inline</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.testcontainers</groupId>
			<artifactId>testcontainers</artifactId>
			<version>1.12.0</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<repositories>
		<repository>
			<id>ossrh</id>
			<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
	</repositories>

	<build>
		<plugins>
			<plugin>
				<groupId>org.web3j</groupId>
				<artifactId>web3j-maven-plugin</artifactId>
				<version>4.8.2</version>
				<configuration>
					<packageName>io.sapl.interpreter.pip.contracts</packageName>
					<sourceDestination>${project.basedir}/target/generated-test-sources/contracts</sourceDestination>
					<nativeJavaType>true</nativeJavaType>
					<outputFormat>java</outputFormat>
					<soliditySourceFiles>
						<directory>${project.basedir}/src/test/resources/solidity</directory>
						<includes>
							<include>**/*.sol</include>
						</includes>
					</soliditySourceFiles>
				</configuration>
				<executions>
					<execution>
						<!-- <?m2e ignore?>  -->
						<id>generate-contracts</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>generate-sources</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.9.1</version>
				<executions>
					<execution>
		        		 <!-- <?m2e execute onConfiguration,onIncremental?>  -->
						<id>add-contracts</id>
						<phase>initialize</phase>
						<goals>
							<goal>add-test-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>target/generated-test-sources/contracts</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>3.3.0</version>
				<configuration>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
				</configuration>
				<executions>
					<execution>
						<id>make-assembly</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
	<profiles>
		<profile>
			<id>integration-tests</id>
		</profile>
		<profile>
			<id>module-tests</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<excludes>
								<exclude>**/EthereumIntegrationTest.java</exclude>
							</excludes>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>