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

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

    <groupId>com.nimbusds</groupId>
    <artifactId>nimbus-jose-jwt</artifactId>
    <version>4.11</version>
    <packaging>jar</packaging>

    <name>Nimbus JOSE+JWT</name>
    <description>
        Java library for Javascript Object Signing and Encryption (JOSE) and
        JSON Web Tokens (JWT)
    </description>

    <url>https://bitbucket.org/connect2id/nimbus-jose-jwt</url>

    <organization>
        <name>Connect2id Ltd.</name>
        <url>http://connect2id.com</url>
    </organization>

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

    <scm>
        <connection>scm:git:https://bitbucket.org/connect2id/nimbus-jose-jwt.git</connection>
        <developerConnection>scm:git:git@bitbucket.org:connect2id/nimbus-jose-jwt.git</developerConnection>
        <url>https://bitbucket.org/connect2id/nimbus-jose-jwt</url>
        <tag>4.11</tag>
    </scm>

    <developers>
        <developer>
            <id>vdzhuvinov</id>
            <name>Vladimir Dzhuvinov</name>
            <email>vladimir@dzhuvinov.com</email>
        </developer>
    </developers>

    <dependencies>
        <dependency>
            <groupId>net.jcip</groupId>
            <artifactId>jcip-annotations</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>net.minidev</groupId>
            <artifactId>json-smart</artifactId>
            <version>1.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15on</artifactId>
            <version>[1.52,]</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk15on</artifactId>
            <version>[1.52,]</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>org.bitbucket.b_c</groupId>
            <artifactId>jose4j</artifactId>
            <version>0.4.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.jadler</groupId>
            <artifactId>jadler-all</artifactId>
            <version>1.1.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.9.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.5</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>buildnumber-maven-plugin</artifactId>
                    <version>1.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.17</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>2.5.0</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <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-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <compilerArgument>-Xlint</compilerArgument>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <author>true</author>
                    <version>true</version>
                    <use>true</use>
                    <linksource>true</linksource>
                    <windowtitle>Nimbus JOSE + JWT v. ${project.version}
                    </windowtitle>
                    <doctitle>Nimbus JOSE + JWT v. ${project.version}</doctitle>
                    <overview>${basedir}/src/main/javadoc/overview.html
                    </overview>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Build-Date>${timestamp}</Build-Date>
                            <Build-Number>${buildNumber}</Build-Number>
                            <Build-Tag>${project.scm.tag}</Build-Tag>
                        </manifestEntries>
                        <!-- Make sure MANIFEST.MF generated by maven-bundle-plugin is used for final JAR -->
                        <manifestFile>
                            ${project.build.outputDirectory}/META-INF/MANIFEST.MF
                        </manifestFile>
                        <manifest>
                            <addDefaultImplementationEntries>true
                            </addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true
                            </addDefaultSpecificationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <getRevisionOnlyOnce>true</getRevisionOnlyOnce>
                    <doCheck>false</doCheck>
                    <doUpdate>false</doUpdate>
                    <timestampFormat>{0,date,yyyyMMdd.HHmmss.SSS}
                    </timestampFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Export-Package>com.nimbusds.jose.*,com.nimbusds.jwt
                        </Export-Package>
                    </instructions>
                </configuration>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
    	<profile>
    		<id>jdk16</id>
			<build>
				<plugins>
			        <plugin>
			            <!-- Using the eclipse compiler allows for different source and target, 
			                which is a good thing (outweighing that this is a rarely used combination, 
			                and most people use javac) This should also allow us to run maven builds 
			                on a JRE and not a JDK. -->
			
			            <groupId>org.apache.maven.plugins</groupId>
			            <artifactId>maven-compiler-plugin</artifactId>
			            <version>3.0</version>
			            <configuration>
			                <source>1.7</source>
			                <target>1.6</target>
			                <fork>true</fork>
			                <compilerId>eclipse</compilerId>
			            </configuration>
			            <dependencies>
			                <dependency>
			                    <groupId>org.codehaus.plexus</groupId>
			                    <artifactId>plexus-compiler-eclipse</artifactId>
			                    <version>2.1</version>
			                </dependency>
			            </dependencies>
			        </plugin>
					<plugin>
						<artifactId>maven-jar-plugin</artifactId>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
								<configuration>
									<classifier>jdk16</classifier>
								</configuration>
							</execution>
						</executions>
					</plugin>
					
				</plugins>
			</build>
    	</profile>
        <profile>
            <id>jdk18</id>
            <build>
                <plugins>
                    <plugin>
                        <!-- Using the eclipse compiler allows for different source and target, 
                            which is a good thing (outweighing that this is a rarely used combination, 
                            and most people use javac) This should also allow us to run maven builds 
                            on a JRE and not a JDK. -->
            
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>3.2</version>
                        <configuration>
                            <source>1.7</source>
                            <target>1.8</target>
                            <fork>true</fork>
                            <compilerId>eclipse</compilerId>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>org.codehaus.plexus</groupId>
                                <artifactId>plexus-compiler-eclipse</artifactId>
                                <version>2.5</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <artifactId>maven-jar-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <classifier>jdk16</classifier>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    
                </plugins>
            </build>
        </profile>
        <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>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
