<?xml version="1.0" encoding="UTF-8"?>
<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>

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>

    <groupId>com.datumbox</groupId>
    <artifactId>libsvm</artifactId>
    <version>3.22</version>

    <name>libsvm</name>
    <description>LIBSVM - A Library for Support Vector Machines</description>
    <url>https://github.com/datumbox/libsvm</url>

    <inceptionYear>2014</inceptionYear>

    <licenses>
        <license>
            <name>BSD 3-Clause License</name>
            <url>http://www.csie.ntu.edu.tw/~cjlin/libsvm/COPYRIGHT</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com/datumbox/libsvm.git</connection>
        <developerConnection>scm:git:git@github.com:datumbox/libsvm.git</developerConnection>
        <url>https://github.com/datumbox/libsvm</url>
    </scm>

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

    <properties>
        <java-version>1.8</java-version>
        <exec-maven-plugin-version>1.3</exec-maven-plugin-version>
        <build-helper-maven-plugin-version>1.8</build-helper-maven-plugin-version>
        <maven-plugin-version>2.3.2</maven-plugin-version>
        <maven-javadoc-plugin-version>2.10.4</maven-javadoc-plugin-version>
        <maven-enforcer-plugin-version>1.2</maven-enforcer-plugin-version>
        <maven-source-plugin-version>3.0.1</maven-source-plugin-version>
        <nexus-staging-maven-plugin-version>1.6.7</nexus-staging-maven-plugin-version>
        <gpg-plugin-version>1.6</gpg-plugin-version>
        <gpg.keyname>7083A486</gpg.keyname>
    </properties>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>${exec-maven-plugin-version}</version>
                <executions>
                    <execution>
                        <id>m4</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <executable>m4</executable>
                    <arguments>
                        <argument>java/libsvm/svm.m4</argument>
                    </arguments>
                    <outputFile>target/generated-sources/libsvm/svm.java</outputFile>
                    <workingDirectory>${project.basedir}</workingDirectory>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>${build-helper-maven-plugin-version}</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.basedir}/java/libsvm</source>
                                <source>${project.basedir}/target/generated-sources/libsvm</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-plugin-version}</version>
                <configuration>
                    <source>${java-version}</source>
                    <target>${java-version}</target>
                    <showDeprecation>true</showDeprecation>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin-version}</version>
			    <executions>
			        <execution>
			            <id>attach-javadocs</id>
			            <goals>
			                <goal>jar</goal>
			            </goals>
			            <configuration>
			                <additionalparam>-Xdoclint:none</additionalparam>
			            </configuration>
			        </execution>
			    </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin-version}</version>
                <executions>
                    <execution>
                        <id>default</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <fail>true</fail>
                    <failFast>false</failFast>
                    <rules>
                        <requireJavaVersion>
                            <version>${java-version}</version>
                        </requireJavaVersion>
                    </rules>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin-version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                            <goal>test-jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${nexus-staging-maven-plugin-version}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>false</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>

	<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>${gpg-plugin-version}</version>
		                <executions>
		                    <execution>
		                        <id>sign-artifacts</id>
		                        <phase>verify</phase>
		                        <goals>
		                            <goal>sign</goal>
		                        </goals>
		                    </execution>
		                </executions>
		            </plugin>
	            </plugins>
	        </build>
	    </profile>
	</profiles>
</project>