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

	<artifactId>junixsocket</artifactId>
	<groupId>eu.agno3</groupId>
	<version>2.5.1</version>

	<packaging>bundle</packaging>
	<name>JUnixSocket</name>
	<description>A JNI library wrapper for UNIX socket support in Java</description>
	<url>https://github.com/AgNO3/junixsocket/</url>


	<licenses>
		<license>
			<name>Apache</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Moritz Bechler</name>
			<email>bechler@agno3.eu</email>
			<organization>AgNO3 GmbH &amp; Co. KG</organization>
			<organizationUrl>https://github.com/AgNO3/</organizationUrl>
		</developer>
	</developers>

	<scm>
		<connection>scm:git:https://github.com/AgNO3/junixsocket.git</connection>
		<developerConnection>scm:git:https://github.com/AgNO3/junixsocket.git</developerConnection>
		<url>git@github.com:AgNO3/junixsocket.git</url>
	  <tag>junixsocket-2.5.1</tag>
  </scm>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
	</distributionManagement>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<java.sourceVersion>1.7</java.sourceVersion>
		<java.targetVersion>1.7</java.targetVersion>
		<maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
		<osgi-version-qualifier>${maven.build.timestamp}</osgi-version-qualifier>
		<project.scm.id>github</project.scm.id>
	</properties>


	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<systemPropertyVariables>
						<org.newsclub.net.unix.library.override>${project.build.directory}/libjunixsocket.so.${project.version}-linux64.jar</org.newsclub.net.unix.library.override>
					</systemPropertyVariables>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>native-maven-plugin</artifactId>
				<extensions>true</extensions>
				<executions>
					<execution>
						<id>gen-native</id>
						<phase>compile</phase>
						<goals>
							<goal>javah</goal>
						</goals>
					</execution>

					<execution>
						<id>gen-amd64</id>
						<phase>compile</phase>
						<goals>
							<goal>initialize</goal>
							<goal>compile</goal>
							<goal>link</goal>
						</goals>
						<configuration>

							<compilerOutputDirectory>${project.build.directory}/linux64</compilerOutputDirectory>
							<compilerStartOptions>
								<compilerStartOption>-m64 -fPIC</compilerStartOption>
							</compilerStartOptions>
							<linkerStartOptions>
								<linkerStartOption>-m64 -shared</linkerStartOption>
							</linkerStartOptions>

							<linkerFinalName>libjunixsocket.so.${project.version}-linux64</linkerFinalName>
							<classifier>jnilib-linux64</classifier>
						</configuration>
					</execution>

					<execution>
						<id>gen-x86</id>
						<phase>compile</phase>
						<goals>
							<goal>initialize</goal>
							<goal>compile</goal>
							<goal>link</goal>
						</goals>
						<configuration>
							<compilerOutputDirectory>${project.build.directory}/linux32</compilerOutputDirectory>
							<compilerStartOptions>
								<compilerStartOption>-m32 -fPIC</compilerStartOption>
							</compilerStartOptions>
							<linkerStartOptions>
								<linkerStartOption>-m32 -shared</linkerStartOption>
							</linkerStartOptions>

							<linkerFinalName>libjunixsocket.so.${project.version}-linux32</linkerFinalName>
							<classifier>jnilib-linux32</classifier>
						</configuration>
					</execution>
				</executions>
				<configuration>
					<javahIncludes>
						<javahInclude>
							<className>org.newsclub.net.unix.NativeUnixSocket</className>
							<headerName>junixsocket.h</headerName>
						</javahInclude>
					</javahIncludes>
					<attach>false</attach>
					<sources>
						<source>
							<directory>src/main/native/</directory>
							<fileNames>
								<fileName>junixsocket.c</fileName>
							</fileNames>
						</source>
					</sources>

					<javahOS>linux</javahOS>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<extensions>true</extensions>

				<configuration>
					<instructions>
						<Bundle-Vendor>AgNO3 GmbH &amp; Co. KG</Bundle-Vendor>
						<Export-Package>
							org.newsclub.net.unix;version="${project.version}"
						</Export-Package>
						<Import-Package>
							org.osgi.framework,
							org.apache.log4j
						</Import-Package>
						<Bundle-NativeCode>
							lib/linux-x86/libjunixsocket.so;osname=Linux;processor=x86,
							lib/linux-amd64/libjunixsocket.so;osname=Linux;processor=x86-64
						</Bundle-NativeCode>
						<Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
						<Include-Resource>{maven-resources},
							lib/linux-amd64/libjunixsocket.so=${project.build.directory}/libjunixsocket.so.${project.version}-linux64.jar,
							lib/linux-x86/libjunixsocket.so=${project.build.directory}/libjunixsocket.so.${project.version}-linux32.jar</Include-Resource>
					</instructions>
					<addDependenciesToRepository>true</addDependenciesToRepository>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<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>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<show>public</show>
					<excludePackageNames>jcifs.dcerpc.*:</excludePackageNames>
					<additionalparam>-Xdoclint:-missing</additionalparam>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>clirr-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>check-compatibility</id>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<ignored>
						<!-- seems to be a clirr bug that it cannot handle 
						     the different inherited return types -->
						<difference>
							<className>**</className>
							<differenceType>7006</differenceType>
							<method>* clone()</method>
							<from>*</from>
							<to>*</to>
						</difference>
					</ignored>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.rat</groupId>
				<artifactId>apache-rat-plugin</artifactId>
				<executions>
					<execution>
						<phase>verify</phase>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<addDefaultLicenseMatchers>true</addDefaultLicenseMatchers>
					<excludes>
						<exclude>pom.xml</exclude>
						<exclude>README*</exclude>
						<exclude>src/test/resources/**</exclude>
					</excludes>
					<licenses>
						<license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
							<licenseFamilyCategory>LGPL</licenseFamilyCategory>
							<licenseFamilyName>GNU Lesser General Public License</licenseFamilyName>
							<notes />
							<patterns>
								<pattern>This library is free software; you can redistribute it</pattern>
								<pattern>GNU Lesser General Public License</pattern>
							</patterns>
						</license>
					</licenses>
					<licenseFamilies>
						<licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
							<familyName>GNU Lesser General Public License</familyName>
						</licenseFamily>
					</licenseFamilies> --&gt;
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.sonatype.plugins</groupId>
				<artifactId>nexus-staging-maven-plugin</artifactId>
				<extensions>true</extensions>
				<configuration>
					<serverId>ossrh</serverId>
					<nexusUrl>https://oss.sonatype.org/</nexusUrl>
					<autoReleaseAfterClose>false</autoReleaseAfterClose>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<configuration>
					<autoVersionSubmodules>true</autoVersionSubmodules>
					<useReleaseProfile>false</useReleaseProfile>
					<releaseProfiles>release</releaseProfiles>
					<goals>deploy</goals>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<executions>
					<execution>
						<id>sign-artifacts</id>
						<phase>verify</phase>
						<goals>
							<goal>sign</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jarsigner-plugin</artifactId>
					<version>1.4</version>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>clirr-maven-plugin</artifactId>
					<version>2.7</version>
				</plugin>
				<plugin>
					<groupId>org.apache.rat</groupId>
					<artifactId>apache-rat-plugin</artifactId>
					<version>0.12</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.3</version>
				</plugin>
				<plugin>
					<groupId>org.apache.felix</groupId>
					<artifactId>maven-bundle-plugin</artifactId>
					<version>3.0.1</version>
				</plugin>
				<plugin>
					<groupId>org.sonatype.plugins</groupId>
					<artifactId>nexus-staging-maven-plugin</artifactId>
					<version>1.6.7</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>1.5</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>2.5.3</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.19.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>2.10.4</version>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>native-maven-plugin</artifactId>
					<version>1.0-alpha-8</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	<dependencies>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.17</version>
		</dependency>
		<dependency>
			<groupId>org.osgi</groupId>
			<artifactId>org.osgi.core</artifactId>
			<version>5.0.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.11</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>
