<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>se.l4.exobytes</groupId>
	<artifactId>exobytes-base</artifactId>
	<version>1.0.2</version>
	<packaging>pom</packaging>

	<name>Exobytes</name>

	<url>https://github.com/LevelFourAB/exobytes</url>

	<description>
		Serialization of objects to and from formats such as CBOR and JSON
	</description>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<modules>
		<module>exobytes</module>
	</modules>

	<!-- License -->
	<licenses>
		<license>
			<name>MIT License</name>
			<url>https://opensource.org/licenses/MIT</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<!-- Common dependencies for shared annotations and tests -->
	<dependencies>
		<dependency>
			<groupId>com.github.spotbugs</groupId>
			<artifactId>spotbugs-annotations</artifactId>
			<version>3.1.12</version>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<version>5.6.2</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-core</artifactId>
			<version>2.2</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<version>2.20.0</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>nl.jqno.equalsverifier</groupId>
			<artifactId>equalsverifier</artifactId>
			<version>3.4.1</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<!-- Managed dependencies used by several projects -->
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.eclipse.collections</groupId>
				<artifactId>eclipse-collections</artifactId>
				<version>10.2.0</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<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>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>
				<configuration>
					<release>9</release>
				</configuration>
			</plugin>

			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.22.2</version>
				<configuration>
					<argLine>--add-opens se.l4.exobytes/se.l4.exobytes=ALL-UNNAMED --add-opens se.l4.exobytes/se.l4.exobytes.standard=ALL-UNNAMED --add-opens se.l4.exobytes/se.l4.exobytes.time=ALL-UNNAMED</argLine>
				</configuration>
			</plugin>

			<plugin>
				<artifactId>maven-failsafe-plugin</artifactId>
				<version>2.22.2</version>
			</plugin>

			<plugin>
				<groupId>com.github.spotbugs</groupId>
				<artifactId>spotbugs-maven-plugin</artifactId>
				<version>4.2.0</version>

				<dependencies>
					<dependency>
						<groupId>com.github.spotbugs</groupId>
						<artifactId>spotbugs</artifactId>
						<version>4.2.1</version>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<effort>max</effort>
					<failOnError>false</failOnError>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.revapi</groupId>
				<artifactId>revapi-maven-plugin</artifactId>
				<version>0.13.2</version>
				<dependencies>
					<dependency>
						<groupId>org.revapi</groupId>
						<artifactId>revapi-java</artifactId>
						<version>0.23.2</version>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<reportSeverity>nonBreaking</reportSeverity>
					<failSeverity>breaking</failSeverity>

					<analysisConfiguration>
						<revapi.java>
							<filter>
								<packages>
									<regex>true</regex>
									<include>
										<item>se\.l4\..*</item>
									</include>
									<exclude>
										<item>.*\.impl(\..+)?</item>
										<item>.*\.internal(\..+)?</item>
									</exclude>
								</packages>
							</filter>
						</revapi.java>

						<revapi.semver.ignore>
							<enabled>true</enabled>
							<versionIncreaseAllows>
								<major>breaking</major>
								<minor>nonBreaking</minor>
								<patch>equivalent</patch>
							</versionIncreaseAllows>
							<passThroughDifferences>
								<item>java.class.nonPublicPartOfAPI</item>
							</passThroughDifferences>
						</revapi.semver.ignore>>

						<revapi.ignore>
							<item>
								<code>java.annotation.added</code>
								<annotationType>edu.umd.cs.findbugs.annotations.NonNull</annotationType>
								<justification>SpotBugs annotations are for bug finding and not code generation</justification>
							</item>

							<item>
								<code>java.annotation.added</code>
								<annotationType>edu.umd.cs.findbugs.annotations.Nullable</annotationType>
								<justification>SpotBugs annotations are for bug finding and not code generation</justification>
							</item>

							<item>
								<code>java.annotation.added</code>
								<annotationType>edu.umd.cs.findbugs.annotations.UnknownNullness</annotationType>
								<justification>SpotBugs annotations are for bug finding and not code generation</justification>
							</item>

							<item>
								<code>java.annotation.added</code>
								<annotationType>edu.umd.cs.findbugs.annotations.CheckReturnValue</annotationType>
								<justification>SpotBugs annotations are for bug finding and not code generation</justification>
							</item>

							<item>
								<code>java.annotation.added</code>
								<annotationType>edu.umd.cs.findbugs.annotations.SuppressFBWarnings</annotationType>
								<justification>SpotBugs annotations are for bug finding and not code generation</justification>
							</item>

							<item>
								<code>java.class.externalClassExposedInAPI</code>
								<justification></justification>
							</item>
						</revapi.ignore>
					</analysisConfiguration>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>no-release</id>
			<activation>
				<property>
					<name>!release</name>
				</property>
			</activation>
			<modules>
				<module>exobytes-benchmarks</module>
			</modules>
		</profile>

		<profile>
			<id>release</id>
			<activation>
				<property>
					<name>release</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>3.2.0</version>
						<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>
						<configuration>
							<doclint>none</doclint>
							<source>9</source>
						</configuration>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<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>

					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.8</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<scm>
		<connection>scm:git:git@github.com:LevelFourAB/exobytes.git</connection>
		<url>git@github.com:LevelFourAB/exobytes.git</url>
		<developerConnection>scm:git:git@github.com:LevelFourAB/exobytes.git</developerConnection>
	</scm>

	<developers>
		<developer>
			<id>aholstenson</id>
			<name>Andreas Holstenson</name>
			<email>a@holstenson.se</email>
		</developer>
	</developers>
</project>
