<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>org.eclipse.basyx</groupId>
	<artifactId>basyx.sdk</artifactId>
	<version>1.4.0</version>
	<name>BaSyx SDK</name>
	<description>BaSyx Software Development Kit</description>
	<url>https://www.eclipse.org/basyx/</url>
	
	<licenses>
		<license>
			<name>MIT</name>
			<url>https://opensource.org/licenses/MIT</url>
		</license>
	</licenses>
	
	<developers>
        <developer>
            <organization>Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V.</organization>
            <id>fschnicke</id>
			<name>Frank Schnicke</name>
			<email>frank.schnicke@iese.fraunhofer.de</email>
        </developer>
    </developers>
	
	<scm>
		<connection>scm:https://github.com/eclipse-basyx/basyx-java-sdk.git</connection>
		<developerConnection>scm:https://github.com/eclipse-basyx/basyx-java-sdk.git</developerConnection>
		<tag>HEAD</tag>
		<url>https://github.com/eclipse-basyx/basyx-java-sdk</url>
	</scm>

	<distributionManagement>
		<repository>
			<id>github</id>
			<name>GitHub Eclipse BaSyx Apache Maven Packages</name>
			<url>https://maven.pkg.github.com/eclipse-basyx/basyx-java-sdk</url>
		</repository>
	</distributionManagement>

	<packaging>jar</packaging>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<spring-security-version>5.8.2</spring-security-version>
	</properties>
	
	<repositories>
		<!--  Additional repository for MQTT Client releases (Paho Java Client) -->
	    <repository>
	        <id>Eclipse Paho Repo</id>
	        <url>https://repo.eclipse.org/content/repositories/paho-releases/</url>
	    </repository>
	</repositories>

	<build>
		<sourceDirectory>src/main/java</sourceDirectory>
		<testSourceDirectory>src/test/java</testSourceDirectory>

		<plugins>
			<!-- Compile Sources using Java 11 -->
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.11.0</version>
				<configuration>
					<source>11</source>
					<target>11</target>
				</configuration>
			</plugin>

			<!-- Attach sources to jar file -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.2.1</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- Generate separate jar for tests and exclude logback.xml from generated jars -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.3.0</version>
				<configuration>
					<excludes>
						<exclude>**/logback.xml</exclude>
					</excludes>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>test-jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- Run Unit Tests -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.0.0</version>
				<configuration>
					<excludes>
						<exclude>**/*HTTP*</exclude>
						<exclude>**/*TCP*</exclude>
					</excludes>
					<includes>
						<include>**/**</include>
					</includes>
				</configuration>
			</plugin>

			<!-- Run Integration Tests -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<version>3.0.0</version>
				<configuration>
					<includes>
						<include>**/*HTTP*</include>
						<include>**/*TCP*</include>
					</includes>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>integration-test</goal>
							<goal>verify</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			
			<!-- Generate javadoc -->
			<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.5.0</version>
                <configuration>
      				<source>8</source>
    			</configuration>
                <executions>
	                <execution>
	                	<goals>
	                    	<goal>jar</goal>
	                    </goals>
	                    <id>generate-javadoc</id>
	                    <phase>package</phase>
	                </execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<dependencies>
		<!-- Logger -->
		<dependency>
    		<groupId>ch.qos.logback</groupId>
    		<artifactId>logback-classic</artifactId>
    		<version>1.4.6</version>
		</dependency>
	
		<!-- JUnit 4 for running JUnit tests -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.13.2</version>
			<scope>test</scope>
		</dependency>

		<!-- Mockito for mocking in JUnit tests -->
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<version>5.2.0</version>
			<scope>test</scope>
		</dependency>

		<!-- Moquette MQTT broker for testing MQTT events -->
		<dependency>
			<groupId>io.moquette</groupId>
			<artifactId>moquette-broker</artifactId>
			<version>0.16</version>
			<scope>test</scope>
		    <exclusions>
				<exclusion> 
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-log4j12</artifactId>
				</exclusion>
		    </exclusions>
		</dependency>

		<!-- Eclipse Milo (for OPC-UA client) -->
		<dependency>
			<groupId>org.eclipse.milo</groupId>
			<artifactId>sdk-client</artifactId>
			<version>0.6.8</version>
		</dependency>

		<!-- Eclipse Milo (for OPC-UA server) -->
		<dependency>
			<groupId>org.eclipse.milo</groupId>
			<artifactId>sdk-server</artifactId>
			<version>0.6.8</version>
		</dependency>

		<!-- Java Servlet API (for HTTP provider) -->
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<version>4.0.1</version>
		</dependency>

		<!-- Java REST API (for WebServiceRawClient) -->
		<dependency>
			<groupId>javax.ws.rs</groupId>
			<artifactId>javax.ws.rs-api</artifactId>
			<version>2.1.1</version>
		</dependency>

		<!-- Java REST Jersey client (for WebServiceRawClient) -->
		<dependency>
			<groupId>org.glassfish.jersey.core</groupId>
			<artifactId>jersey-client</artifactId>
			<version>2.39.1</version>
		</dependency>

		<!-- Jersey InjectionManager (for Jersey client)  -->
		<dependency>
			<groupId>org.glassfish.jersey.inject</groupId>
			<artifactId>jersey-hk2</artifactId>
			<version>2.39.1</version>
		</dependency>

		<!-- Tomcat 8 for HTTP server resource -->
		<dependency>
			<groupId>org.apache.tomcat</groupId>
			<artifactId>tomcat-catalina</artifactId>
			<version>9.0.73</version>
		</dependency>

		<!-- Used for creating .aasx files -->
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-ooxml</artifactId>
			<version>4.1.2</version>
		</dependency>
		
		<!-- Used by Logback to compile filter expressions from logback.xml -->
		<dependency>
    		<groupId>org.codehaus.janino</groupId>
    		<artifactId>janino</artifactId>
    		<version>3.1.9</version>
		</dependency>
		
		<!-- Paho Java Client for MQTT -->
		<dependency>
			<groupId>org.eclipse.paho</groupId>
			<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
			<version>1.2.5</version>
		</dependency>
		
		<!-- JSON Serialization -->
		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
			<version>2.10.1</version>
		</dependency>
		
		<!-- Handles resources & files -->
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.11.0</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload -->
		<dependency>
		    <groupId>commons-fileupload</groupId>
		    <artifactId>commons-fileupload</artifactId>
		    <version>1.5</version>
		</dependency>
		
		<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpmime -->
		<dependency>
		    <groupId>org.apache.httpcomponents</groupId>
		    <artifactId>httpmime</artifactId>
		    <version>4.5.14</version>
		</dependency>
		
		<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
		<dependency>
		    <groupId>org.apache.httpcomponents</groupId>
		    <artifactId>httpclient</artifactId>
		    <version>4.5.14</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>3.12.0</version>
		</dependency>

		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-oauth2-resource-server</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-oauth2-jose</artifactId>
		</dependency>

		<!-- https://mvnrepository.com/artifact/org.keycloak/keycloak-admin-client -->
		<dependency>
			<groupId>org.keycloak</groupId>
			<artifactId>keycloak-admin-client</artifactId>
			<version>19.0.3</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<version>2.14.2</version>
		</dependency>

		<dependency>
			<groupId>org.mock-server</groupId>
			<artifactId>mockserver-netty</artifactId>
			<version>5.9.0</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.mock-server</groupId>
			<artifactId>mockserver-client-java</artifactId>
			<version>5.9.0</version>
			<scope>test</scope>
		</dependency>
		
		<dependency>
			<groupId>org.apache.httpcomponents.client5</groupId>
			<artifactId>httpclient5</artifactId>
			<version>5.2.1</version>
			<scope>test</scope>
		</dependency>
		
		<dependency>
		    <groupId>org.apache.tika</groupId>
		    <artifactId>tika-core</artifactId>
		    <version>2.7.0</version>
		</dependency>
	</dependencies>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.springframework.security</groupId>
				<artifactId>spring-security-bom</artifactId>
				<version>${spring-security-version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	
	<profiles>
		<profile>
			<id>MavenCentral</id>
			<distributionManagement>
				<snapshotRepository>
					<id>ossrh</id>
					<url>https://oss.sonatype.org/content/repositories/snapshots</url>
				</snapshotRepository>
				<repository>
					<id>ossrh</id>
					<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
				</repository>
			</distributionManagement>
			<build>
				<plugins>
					<!-- Signing the artifacts -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>3.0.1</version>
						<executions>
						  <execution>
							<id>sign-artifacts</id>
							<phase>verify</phase>
							<goals>
							  <goal>sign</goal>
							</goals>
							<configuration>
							  <gpgArguments>
								<arg>--pinentry-mode</arg>
								<arg>loopback</arg>
							  </gpgArguments>
							</configuration>
						  </execution>
						</executions>
					</plugin>
					
					<!-- Upload to Maven Central -->
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.13</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>

