<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>me.pustinek</groupId>
	<artifactId>interactivemessenger</artifactId>
    <version>1.2.2</version>
	<name>interactivemessenger-${version}</name>
	<description>InteractiveMessenger is a plugin that allows you to create interactive messages in Minecraft</description>
	<url>https://github.com/pustinek/InteractiveMessenger</url>


	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>
	</properties>

	<licenses>
		<license>
			<name>MIT License</name>
			<url>http://www.opensource.org/licenses/mit-license.php</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Pustinek</name>
			<email>ziga.pustoslemsek@gmail.com</email>
		</developer>
	</developers>

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

	<repositories>
		<repository>
			<id>spigot-repo</id>
			<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
		</repository>
		<repository>
			<id>maven_central</id>
			<name>Maven Central</name>
			<url>https://repo.maven.apache.org/maven2/</url>
		</repository>
	</repositories>

	<dependencies>
		<dependency>
			<groupId>org.bukkit</groupId>
			<artifactId>bukkit</artifactId>
			<version>1.8-R0.1-SNAPSHOT</version>
			<type>jar</type>
			<scope>provided</scope>
		</dependency>

		<!-- Google Gson, only used for the tests -->
		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
			<version>2.10</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.13.2</version>
			<scope>test</scope>
		</dependency>
	</dependencies>



	<profiles>
		<!-- Run ingame tests using a plugin, active using: -DtestIngame="/path/to/test/server" -->
		<!-- Don't use the 'install' command if this option is used -->
		<profile>
			<id>test-ingame</id>
			<activation>
				<property>
					<name>testIngame</name>
				</property>
			</activation>
			<dependencies>
				<dependency>
					<groupId>com.google.code.gson</groupId>
					<artifactId>gson</artifactId>
					<version>2.8.0</version>
					<scope>compile</scope>
				</dependency>
				<dependency>
					<groupId>junit</groupId>
					<artifactId>junit</artifactId>
					<version>4.11</version>
					<scope>provided</scope>
				</dependency>
			</dependencies>
			<build>
				<directory>target</directory>
				<finalName>InteractiveMessengerTest</finalName>
				<resources>
					<resource>
						<targetPath>.</targetPath>
						<filtering>true</filtering>
						<directory>src/test/resources</directory>
					</resource>
				</resources>
				<plugins>

					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>build-helper-maven-plugin</artifactId>
						<version>3.0.0</version>
						<executions>
							<execution>
								<id>add-sources</id>
								<phase>generate-sources</phase>
								<goals>
									<goal>add-source</goal>
								</goals>
								<configuration>
									<sources>
										<source>${basedir}/src/test/java</source>
									</sources>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-shade-plugin</artifactId>
						<version>2.4.3</version>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>shade</goal>
								</goals>
								<configuration>
									<relocations>
										<!-- Relocate GSON -->
										<relocation>
											<pattern>com.google.gson</pattern>
											<shadedPattern>me.pustinek.interactivemessenger.shaded.gson</shadedPattern>
										</relocation>
									</relocations>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-antrun-plugin</artifactId>
						<version>1.8</version>
						<configuration>
							<target>
								<copy file="./target/${project.build.finalName}.jar" tofile="${testIngame}\${project.build.finalName}.jar"/>
							</target>
						</configuration>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>

			</build>
		</profile>
	</profiles>

	<build>
		<directory>target</directory>
		<finalName>${project.name}</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.5.1</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.19.1</version>
				<configuration>
					<includes>
						<!-- Test suite is not detected as test automatically -->
						<include>**/RunTests.class</include>
						<include>**/testing/unit/**</include>
					</includes>
					<argLine>-Dfile.encoding=UTF-8</argLine>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<version>2.8.2</version>
			</plugin>
			<plugin>
				<groupId>org.sonatype.central</groupId>
				<artifactId>central-publishing-maven-plugin</artifactId>
				<version>0.4.0</version>
				<extensions>true</extensions>
				<configuration>
					<publishingServerId>central</publishingServerId>
					<tokenAuth>true</tokenAuth>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.3.1</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<phase>verify</phase>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>3.7.0</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<phase>verify</phase>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>3.2.4</version>
				<executions>
					<execution>
						<id>sign-artifacts</id>
						<phase>verify</phase>
						<goals>
							<goal>sign</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>