<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 2020, 2022 Contributors to Eclipse Foundation. All rights reserved.
    Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v. 2.0, which is available at
    http://www.eclipse.org/legal/epl-2.0.

    This Source Code may also be made available under the following Secondary
    Licenses when the conditions for such availability set forth in the
    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
    version 2 with the GNU Classpath Exception, which is available at
    https://www.gnu.org/software/classpath/license.html.

    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.eclipse.ee4j</groupId>
        <artifactId>project</artifactId>
        <version>1.0.6</version>
        <relativePath/>
    </parent>

    <groupId>jakarta.authentication</groupId>
    <artifactId>jakarta.authentication-api</artifactId>
    <version>3.0.0</version>

    <name>Jakarta Authentication</name>
    <description>
        Jakarta Authentication defines a general low-level SPI for authentication mechanisms, which are controllers
        that interact with a caller and a container's environment to obtain the caller's credentials, validate these,
        and pass an authenticated identity (such as name and groups) to the container. 
        
        Jakarta Authentication consists of several profiles, with each profile telling how a specific container
        (such as Jakarta Servlet) can integrate with- and adapt to this SPI.
    </description>
    <url>https://github.com/eclipse-ee4j/authentication</url>
    <organization>
        <name>Jakarta Authentication</name>
        <url>https://github.com/eclipse-ee4j/authentication</url>
    </organization>
    <licenses>
        <license>
            <name>EPL 2.0</name>
            <url>http://www.eclipse.org/legal/epl-2.0</url>
            <distribution>repo</distribution>
        </license>
        <license>
            <name>GPL2 w/ CPE</name>
            <url>https://www.gnu.org/software/classpath/license.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>atijms</id>
            <name>Arjan Tijms</name>
            <email>arjan.tijms@gmail.com</email>
            <roles>
                <role>Project-Lead</role>
                <role>comitter</role>
                <role>developer</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
        <developer>
            <id>yaminikb</id>
            <name>Yamini K B</name>
            <organization>Oracle Corporation</organization>
            <organizationUrl>http://www.oracle.com/</organizationUrl>
        </developer>
    </developers>
    <contributors>
        <contributor>
            <name>Ronald Monzillo</name>
            <organization>Oracle Corporation</organization>
            <organizationUrl>http://www.oracle.com/</organizationUrl>
        </contributor>
    </contributors>

    <scm>
        <connection>scm:git:ssh://git@github.com/eclipse-ee4j/authentication.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/eclipse-ee4j/authentication.git</developerConnection>
        <url>https://github.com/eclipse-ee4j/authentication</url>
    </scm>
    <issueManagement>
        <system>github</system>
        <url>https://github.com/eclipse-ee4j/authentication/issues</url>
    </issueManagement>

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

        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>

    <build>
        <defaultGoal>install</defaultGoal>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.html</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>META-INF/README</exclude>
                    <exclude>${findbugs.exclude}</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>${project.basedir}/..</directory>
                <includes>
                    <include>LICENSE.md</include>
                    <include>NOTICE.md</include>
                </includes>
                <targetPath>META-INF</targetPath>
            </resource>
            <resource>
                <directory>${project.basedir}</directory>
                <includes>
                    <include>LICENSE.md</include>
                    <include>NOTICE.md</include>
                </includes>
                <targetPath>META-INF</targetPath>
            </resource>
        </resources>
        <plugins>
            <!-- Sets minimal Maven version to 3.6.0 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.6.0</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        
            <!-- Restricts the Java version to 11 -->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.0</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                    <compilerArgument>-Xlint:unchecked</compilerArgument>
                </configuration>
            </plugin>
        
            <!-- First sets properties for the maven-bundle-plugin and later checks if they are indeed used. -->
            <plugin>
                <groupId>org.glassfish.build</groupId>
                <artifactId>spec-version-maven-plugin</artifactId>
                <version>2.1</version>
                <configuration>
                    <spec>
                        <specVersion>3.0</specVersion>
                        <specImplVersion>${project.version}</specImplVersion>
                        <apiPackage>jakarta.security.auth.message</apiPackage>
                    </spec>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>set-spec-properties</goal>
                            <goal>check-module</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
            <!-- Creates the OSGi MANIFEST.MF file -->
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>5.1.4</version>
                <configuration>
                    <supportedProjectTypes>
                        <supportedProjectType>jar</supportedProjectType>
                    </supportedProjectTypes>
                    <instructions>
                        <Bundle-Version>${spec.bundle.version}</Bundle-Version>
                        <Bundle-SymbolicName>${spec.bundle.symbolic-name}</Bundle-SymbolicName>
                        <Extension-Name>${spec.extension.name}</Extension-Name>
                        <Implementation-Version>${spec.implementation.version}</Implementation-Version>
                        <Specification-Version>${spec.specification.version}</Specification-Version>                        
                        <Bundle-Description>
                            Jakarta Authentication ${spec.specification.version} Specification
                        </Bundle-Description>
                        <Specification-Vendor>Oracle Corporation</Specification-Vendor>
                        <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
                        <Implementation-Vendor-Id>org.glassfish</Implementation-Vendor-Id>
                        <_include>-${basedir}/osgi.bundle</_include>
                    </instructions>
                </configuration>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
            <!-- Adds the manifest file created by the org.apache.felix:maven-bundle-plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.2</version>
                <configuration>
                    <archive>
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                    </archive>
                    <excludes>
                        <exclude>**/*.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
            
            <!-- 
               Create Javadoc for API jar
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.3.1</version>
                <executions>
                    <execution>
                        <id>attach-api-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <source>11</source>
                            <additionalJOption>-Xdoclint:none</additionalJOption>
                            <description>Jakarta Authentication API documentation</description>
                            <doctitle>Jakarta Authentication API documentation</doctitle>
                            <windowtitle>Jakarta Authentication API documentation</windowtitle>
                            <header><![CDATA[<br>Jakarta Authentication API v${project.version}]]></header>
                            <bottom><![CDATA[
Comments to: <a href="mailto:jaspic-dev@eclipse.org">jaspic-dev@eclipse.org</a>.<br>
Copyright &#169; 2020, 2022 Eclipse Foundation. All rights reserved.<br>
Use is subject to <a href="{@docRoot}/doc-files/speclicense.html" target="_top">license terms</a>.]]>
                            </bottom>
                            <docfilessubdirs>true</docfilessubdirs>
                            <groups>
                                <group>
                                    <title>Jakarta Authentication API Documentation</title>
                                    <packages>
                                        jakarta.security.auth.message
                                        jakarta.security.auth.message.callback
                                        jakarta.security.auth.message.config
                                        jakarta.security.auth.message.module
                                    </packages>
                                </group>
                            </groups>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
