<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.zeromq</groupId>
	<artifactId>jeromq-jms</artifactId>
	<version>3.0.1-RELEASE</version>
	<packaging>jar</packaging>

	<name>jeromq-jms</name>
	<description>ZeroMQ implementation of the JMS API</description>
	<url>https://github.com/zeromq/jeromq-jms</url>

	<licenses>
		<license>
			<name>Mozilla Public License (MPL) version 2.0</name>
			<url>http://mozilla.org/MPL/2.0/</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Jeremy Miller</name>
			<email>mjeremym@gmail.com</email>
			<organization>zeromq</organization>
			<organizationUrl></organizationUrl>
		</developer>
	</developers>

	<scm>
		<url>git@github.com:zeromq/jeromq-jms.git</url>
		<connection>scm:git:git@github.com:zeromq/jeromq-jms.git</connection>
		<developerConnection>scm:git:git@github.com:zeromq/jeromq-jms.git</developerConnection>
		<tag>HEAD</tag>
	</scm>

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

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

		<version.java>1.8</version.java>
		<version.jeromq>0.4.3</version.jeromq>
		<version.jms>2.0.1</version.jms>
		<version.junit>4.12</version.junit>
		<version.spring>5.1.4.RELEASE</version.spring>
		<version.tomcat-catalina>8.5.30</version.tomcat-catalina>
		<version.protobuf-java>3.6.1</version.protobuf-java>
		<version.jackson>2.9.8</version.jackson>

		<checkstyle.config.location>src/checkstyle.xml</checkstyle.config.location>
		<!-- 
			export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home 
			launchctl setenv JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home

		<path.toolsjar>${java.home}/../lib/tools.jar</path.toolsjar>
		<path.jconsolejar>${java.home}/../lib/jconsole.jar</path.jconsolejar>

		-->
		<path.toolsjar>/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/lib/tools.jar</path.toolsjar>
		<path.jconsolejar>/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/lib/jconsole.jar</path.jconsolejar>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.zeromq</groupId>
			<artifactId>jeromq</artifactId>
			<version>${version.jeromq}</version>
		</dependency>

		<dependency>
			<groupId>javax.jms</groupId>
			<artifactId>javax.jms-api</artifactId>
			<version>${version.jms}</version>
		</dependency>

		<dependency>
			<groupId>com.sun.tools</groupId>
			<artifactId>jconsole</artifactId>
			<version>${version.java}</version>
			<scope>system</scope>
			<systemPath>${path.jconsolejar}</systemPath>
		</dependency>
		<dependency>
			<groupId>com.sun.tools</groupId>
			<artifactId>tools</artifactId>
			<version>${version.java}</version>
			<scope>system</scope>
  			<systemPath>${path.toolsjar}</systemPath>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>${version.junit}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<version>${version.spring}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>${version.spring}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-jms</artifactId>
			<version>${version.spring}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<version>${version.spring}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.tomcat</groupId>
			<artifactId>tomcat-catalina</artifactId>
			<version>${version.tomcat-catalina}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.google.protobuf</groupId>
			<artifactId>protobuf-java</artifactId>
			<version>${version.protobuf-java}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<version>${version.jackson}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<finalName>jeromq-jms</finalName>
		<!-- <testSourceDirectory>src/test/java</testSourceDirectory> -->

		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
                <version>3.0.0</version>				
				<executions>
					<execution>
						<phase>generate-test-sources</phase>
						<goals>
							<goal>add-test-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>${project.build.directory}/generated-test-sources</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.github.os72</groupId>
				<artifactId>protoc-jar-maven-plugin</artifactId>
				<version>3.2.0.1</version>
				<executions>
					<execution>
						<!-- <phase>generate-sources</phase> -->
						<phase>generate-test-sources</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<protocVersion>3.2.0</protocVersion> <!-- 2.4.1, 2.5.0, 2.6.1, 3.2.0 -->
							<inputDirectories>
								<include>src/test/resources</include>
							</inputDirectories>
							<outputTargets>
								<outputTarget>
									<type>java</type>
									<addSources>none</addSources>
									<outputDirectory>${project.build.directory}/generated-test-sources</outputDirectory>
								</outputTarget>
								<outputTarget>
									<type>descriptor</type>
									<addSources>none</addSources>
									<outputDirectory>${project.build.directory}/generated-test-sources</outputDirectory>
								</outputTarget>
							</outputTargets>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.2</version>
				<configuration>
					<source>${version.java}</source>
					<target>${version.java}</target>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>2.4</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.10.1</version>
				<configuration>
					<source>8</source>
				</configuration>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<!-- http://maven.apache.org/enforcer/enforcer-rules/index.html -->
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>1.4.1</version>
				<executions>
					<execution>
						<id>default-cli</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<DependencyConvergence />
								<requireJavaVersion>
									<version>${version.java}</version>
								</requireJavaVersion>
								<enforceBytecodeVersion>
									<maxJdkVersion>${version.java}</maxJdkVersion>
								</enforceBytecodeVersion>
							</rules>
							<fail>true</fail>
						</configuration>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>extra-enforcer-rules</artifactId>
						<version>1.0-beta-6</version>
					</dependency>
				</dependencies>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<version>2.11</version>
				<executions>
					<execution>
						<phase>validate</phase>

						<!-- <phase>verify</phase> -->
						<goals>
							<goal>check</goal>
						</goals>
						<configuration>
							<consoleOutput>true</consoleOutput>
							<includeTestSourceDirectory>true</includeTestSourceDirectory>
							<!-- <configLocation>src/checkstyle.xml</configLocation> -->
							<failOnViolation>true</failOnViolation>
							<excludes>**/generated-sources/**/*</excludes>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<version>4.0.0</version>
				<extensions>true</extensions>
				<configuration>
					<instructions>
						<Export-Package>org.zeromq.jms</Export-Package>
						<Export-Package>org.zeromq.jms.*</Export-Package>
					</instructions>
				</configuration>
			</plugin>
		</plugins>

		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<configuration>
						<systemProperties>
							<property>
								<name>java.util.logging.config.file</name>
								<value>src/test/resources/logging.properties</value>
							</property>
						</systemProperties>
					</configuration>
				</plugin>

				<!--This plugin's configuration is used to store Eclipse m2e settings 
					only. It has no influence on the Maven build itself. -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.apache.maven.plugins</groupId>
										<artifactId>maven-checkstyle-plugin</artifactId>
										<versionRange>[2.11,)</versionRange>
										<goals>
											<goal>check</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<reportSets>
					<reportSet>
						<reports>
							<report>checkstyle</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
		</plugins>
	</reporting>

	<profiles>
		<profile>
			<id>release-sign-artifacts</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<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>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
