<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/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<name>eBUS core library</name>
	<description>eBUS core library - This library handles the communication with heating engineering via the BUS specification. This protocol is used by many heating manufacturers in Europe.</description>
	<groupId>de.cs-dev.ebus</groupId>
	<artifactId>ebus-core</artifactId>
	<version>1.1.1</version>
	<url>https://github.com/csowada/ebus</url>
	<packaging>bundle</packaging>

	<properties>
		<maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<maven.compiler.release>8</maven.compiler.release>
		<license.year>2020</license.year>
		<!-- <bundle.version>1.1.0.${maven.build.timestamp}</bundle.version> -->
	</properties>

	<organization>
		<name>Christian Sowada</name>
		<url>http://www.cs-dev.de</url>
	</organization>

	<licenses>
		<license>
			<name>Eclipse Public License</name>
			<url>http://www.eclipse.org/legal/epl-v10.html</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<email>git@cs-dev.de</email>
			<name>Christian Sowada</name>
			<url>https://github.com/csowada</url>
			<id>csowada</id>
		</developer>
	</developers>

	<issueManagement>
		<url>https://github.com/csowada/ebus/issues</url>
		<system>GitHub Issues</system>
	</issueManagement>

	<scm>
		<connection>scm:git:git://github.com/csowada/ebus.git</connection>
		<developerConnection>scm:git:git://github.com/csowada/ebus.git</developerConnection>
		<url>scm:git:git@github.com/csowada/ebus.git</url>
		<tag>HEAD</tag>
	</scm>

	<build>
		<plugins>

			<plugin>
				<groupId>com.amashchenko.maven.plugin</groupId>
				<artifactId>gitflow-maven-plugin</artifactId>
				<version>1.15.0</version>
				<configuration>
				<gitFlowConfig>
					<productionBranch>master</productionBranch>
					<developmentBranch>develop</developmentBranch>
					<versionTagPrefix>v</versionTagPrefix>
					<origin>origin</origin>
				</gitFlowConfig>
				<fetchRemote>false</fetchRemote>
				<pushRemote>false</pushRemote>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>buildnumber-maven-plugin</artifactId>
				<version>1.4</version>
				<executions>
					<execution>
						<goals>
							<goal>create</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<!-- Get the scm revision once for all modules -->
					<getRevisionOnlyOnce>true</getRevisionOnlyOnce>
					<!-- Don't fail on modified local resources -->
					<doCheck>false</doCheck>
					<!-- Don't update SCM -->
					<doUpdate>false</doUpdate>
					<!-- Use short version of git revision -->
					<shortRevisionLength>7</shortRevisionLength>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<version>1.4.0</version>
				<extensions>true</extensions>
				<configuration>
					<instructions>
						<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
						<Bundle-Name>${project.name}</Bundle-Name>
						<Bundle-Version>${bundle.version}</Bundle-Version>
						<Export-Package>de.csdev.ebus.*</Export-Package>
						<opt>resolution:=optional</opt>
						<Import-Package>org.slf4j;$[opt], com.fazecast.jSerialComm;$[opt], gnu.io;$[opt], *</Import-Package>

						<Build-Timestamp>${maven.build.timestamp}</Build-Timestamp>
						<Build-Commit>${buildNumber}</Build-Commit>
						<Build-Branch>${scmBranch}</Build-Branch>
						<Build-Number>${env.BUILD_NUMBER}</Build-Number>
					</instructions>
				</configuration>
			</plugin>

			<plugin>
				<groupId>com.mycila</groupId>
				<artifactId>license-maven-plugin</artifactId>
				<version>3.0</version>
				<configuration>
					<basedir>${basedir}</basedir>
					<header>src/etc/header.txt</header>
					<quiet>false</quiet>
					<failIfMissing>true</failIfMissing>
					<strictCheck>true</strictCheck>
					<aggregate>true</aggregate>
					<mapping>
						<xml>xml-header-style</xml>
					</mapping>
					<headerDefinitions>
						<headerDefinition>src/etc/xml-header-style.xml</headerDefinition>
					</headerDefinitions>
					<includes>
						<include>**/de/csdev/**/*.java</include>
						<include>**/feature.xml</include>
						<include>**/OSGI-INF/*.xml</include>
					</includes>
					<excludes>
						<exclude>target/**</exclude>
						<exclude>**/pom.xml</exclude>
						<exclude>_*.java</exclude>
					</excludes>
					<useDefaultExcludes>true</useDefaultExcludes>
					<properties>
						<year>${license.year}</year>
					</properties>
					<encoding>UTF-8</encoding>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

		</plugins>
	</build>

	<profiles>

		<profile>
			<id>sign</id>
			<build>
				<plugins>
					<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>
								<configuration>
					                <!-- Prevent `gpg` from using pinentry programs -->
					                <gpgArguments>
					                    <arg>--pinentry-mode</arg>
					                    <arg>loopback</arg>
					                </gpgArguments>
					            </configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>build-extras</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>3.0.1</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.0.0</version>
						<configuration>
							<doclint>none</doclint>
						</configuration>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>deploy-ossrh</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>

			<build>
				<plugins>
					<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>false</autoReleaseAfterClose>
						</configuration>
					</plugin>
				</plugins>
			</build>

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

		<profile>
			<id>deploy-github</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>

			<distributionManagement>
				<repository>
				<id>github</id>
				<name>GitHub Packages</name>
				<url>https://maven.pkg.github.com/csowada/ebus</url>
				</repository>
			</distributionManagement>
		</profile>

	</profiles>

	<dependencies>

		<dependency>
			<groupId>org.apache.felix</groupId>
			<artifactId>org.osgi.core</artifactId>
			<version>1.4.0</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>1.0.13</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>1.7.25</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.2</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
			<version>2.6</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>com.neuronrobotics</groupId>
			<artifactId>nrjavaserial</artifactId>
			<version>3.12.1</version>
			<scope>provided</scope>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>com.fazecast</groupId>
			<artifactId>jSerialComm</artifactId>
			<version>2.5.3</version>
			<scope>provided</scope>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
			<version>2.5</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.eclipse.jdt</groupId>
			<artifactId>org.eclipse.jdt.annotation</artifactId>
			<version>2.2.600</version>
			<scope>provided</scope>
		</dependency>

	</dependencies>

</project>
