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

	<groupId>org.bitbucket.simon_massey</groupId>
	<artifactId>thinbus-srp6a-js</artifactId>
	<version>1.4.2</version>
	<packaging>jar</packaging>

	<name>Thinbus SRP6a</name>
	<description>Complete Secure Remote Password (SRP-6a) client session implementation written in Javascript / EMCAScript with a compatible server implementation written with Java Nimbus SRP6a. </description>
	<url>https://bitbucket.org/simon_massey/thinbus-srp-js</url>

	<licenses>
		<license>
			<name>The Apache Software License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Simon Massey</name>
			<email>simon_massey@hotmail.com</email>
			<organization>spouse</organization>
			<organizationUrl>https://bitbucket.org/simon_massey</organizationUrl>
		</developer>
	</developers>

	<scm>
		<connection>scm:git:https://bitbucket.org/simon_massey/thinbus-srp-js.git</connection>
		<developerConnection>scm:git:https://bitbucket.org/simon_massey/thinbus-srp-js.git</developerConnection>
		<url>https://bitbucket.org/simon_massey/thinbus-srp-js</url>
		<tag>HEAD</tag>
	</scm>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <nimbusds.version>2.0.2</nimbusds.version>
        <junit-js.version>1.0.0</junit-js.version>
		<dhParamMainClass>com.bitbucket.thinbus.srp6.js.OpenSSLCryptoConfigConverter</dhParamMainClass>
	</properties>

	<dependencies>
		<dependency>
			<groupId>com.nimbusds</groupId>
			<artifactId>srp6a</artifactId>
			<version>${nimbusds.version}</version>
			<scope>compile</scope>
		</dependency>

		<dependency>
            <groupId>org.bitbucket.thinbus</groupId>
            <artifactId>junit-js</artifactId>
			<version>${junit-js.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

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

	<build>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
		</resources>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>2.2</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.0</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>2.9</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>2.4</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-assembly-plugin</artifactId>
					<version>2.4</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>2.7</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>2.3.2</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>1.1</version>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>buildnumber-maven-plugin</artifactId>
					<version>1.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.12.4</version>
				</plugin>
			</plugins>
		</pluginManagement>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<manifestEntries>
							<Build-Date>${timestamp}</Build-Date>
						</manifestEntries>
						<manifest>
							<mainClass>${dhParamMainClass}</mainClass>
						</manifest>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration>
					<linksource>true</linksource>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
					<compilerArgument>-Xlint</compilerArgument>
				</configuration>
			</plugin>
			<plugin>
				<groupId>net.alchim31.maven</groupId>
				<artifactId>yuicompressor-maven-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>compress</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<jswarn>false</jswarn>
					<failOnWarning>false</failOnWarning>
					<aggregations>
						<aggregation>
							<insertNewLine>true</insertNewLine>
							<output>${project.build.directory}/classes/js/thinbus-srp6a-deps-min.js</output>
							<includes>
								<include>${project.build.directory}/classes/js/biginteger-min.js</include>
								<include>${project.build.directory}/classes/js/isaac-min.js</include>
								<include>${project.build.directory}/classes/js/random-min.js</include>
							</includes>
						</aggregation>
						<aggregation>
							<insertNewLine>true</insertNewLine>
							<output>${project.build.directory}/classes/js/thinbus-srp6a-sha256-min.js</output>
							<includes>
								<include>${project.build.directory}/classes/js/sha256-min.js</include>
								<include>${project.build.directory}/classes/js/thinbus-srp6a-deps-min.js</include>
								<include>${project.build.directory}/classes/js/thinbus-srp6client-min.js</include>
								<include>${project.build.directory}/classes/js/thinbus-srp6client-sha256.js</include>
							</includes>
						</aggregation>
					</aggregations>
				</configuration>
			</plugin>
			<plugin>
				<groupId>ro.isdc.wro4j</groupId>
				<artifactId>wro4j-maven-plugin</artifactId>
				<version>1.7.6</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>jshint</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<options>devel,noarg,latedef,undef,unused,strict,browser,nonbsp,noempty,newcap,immed,freeze,eqeqeq,bitwise</options>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<archive>
						<manifest>
							<mainClass>com.bitbucket.thinbus.srp6.js.OpenSSLCryptoConfigConverter</mainClass>
						</manifest>
					</archive>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.sonatype.plugins</groupId>
				<artifactId>nexus-staging-maven-plugin</artifactId>
				<version>1.6.3</version>
				<extensions>true</extensions>
				<configuration>
					<serverId>ossrh</serverId>
					<nexusUrl>https://oss.sonatype.org/</nexusUrl>
					<autoReleaseAfterClose>true</autoReleaseAfterClose>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>1.5</version>
				<executions>
					<execution>
						<id>sign-artifacts</id>
						<phase>verify</phase>
						<goals>
							<goal>sign</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.4</version>
				<executions>
					<execution>
						<phase>package</phase>
						<configuration>
							<tasks>
								<concat destfile="${project.build.outputDirectory}/js/thinbus-srp6a-sha256-versioned.js" binary="yes">
									<fileset file="${project.build.outputDirectory}/js/thinbus-version.js" />
									<fileset file="${project.build.outputDirectory}/js/thinbus-srp6a-sha256-min.js" />
								</concat>
							</tasks>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<version>1.2.1</version>
				<configuration>
					<mainClass>${dhParamMainClass}</mainClass>
					<arguments>
						<argument>./my_dhparam.txt</argument>
						<argument>SHA-256</argument>
                    </arguments>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>
