<!--

    Copyright (c) 2015, 2018 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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
       <groupId>org.omnifaces</groupId>
       <artifactId>parent</artifactId>
       <version>1.1-m02</version>
    </parent>

    <artifactId>javax.security.enterprise</artifactId>
    <packaging>bundle</packaging>

    <name>Soteria Reference Implementation</name>
    <description>Reference Implementation for Java EE Security API</description>

    <properties>
        <packages.export>org.glassfish.soteria.*</packages.export>
        <lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
        <spec-version-maven-plugin.version>1.2</spec-version-maven-plugin.version>
        <junit.version>4.12</junit.version>
        <servlet.version>3.1.0</servlet.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>javax.security.enterprise</groupId>
            <artifactId>javax.security.enterprise-api</artifactId>
            <version>${api_dependency_version}</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>${servlet.version}</version>
            <scope>test</scope> <!-- Needed to implement and instantiate HttpServletRequest -->
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.glassfish.build</groupId>
                <artifactId>spec-version-maven-plugin</artifactId>
                <version>${spec-version-maven-plugin.version}</version>
                <configuration>
                    <spec>
                        <nonFinal>${non_final}</nonFinal>
                        <jarType>impl</jarType>
                        <apiPackage>${api_package}</apiPackage>
                        <implNamespace>${impl_namespace}</implNamespace>
                        <specVersion>${spec_version}</specVersion>
                        <newSpecVersion>${new_spec_version}</newSpecVersion>
                        <specImplVersion>${spec_impl_version}</specImplVersion>
                        <specBuild>${spec_build}</specBuild>
                        <implVersion>${impl_version}</implVersion>
                        <newImplVersion>${new_impl_version}</newImplVersion>
                        <implBuild>${impl_build}</implBuild>
                    </spec>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>set-spec-properties</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
            <!--
             This plugin is reponsible for packaging artifacts
             as OSGi bundles.  Please refer to
             http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html
             for more information about how to use this plugin.
           	-->
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${spec.bundle.symbolic-name}</Bundle-SymbolicName>
                        <Bundle-Version>${spec.bundle.version}</Bundle-Version>
                        <Extension-Name>${spec.extension.name}</Extension-Name>
                        <Implementation-Version>${spec.implementation.version}</Implementation-Version>
                        <!--
                            The spec-version-maven-plugin doesn't seem to be generating the correct
                            Specification-Version as specified by the Glassfish Maven Versioning Rules
                            document. Hard-wire it here.

                            https://javaee.github.io/glassfish/wiki-archive/Maven%20Versioning%20Rules.html

                            <Specification-Version>${spec.specification.version}</Specification-Version>
                        -->
                        <Specification-Version>${spec_version}.99.${spec_build}</Specification-Version>
                        <Export-Package>${packages.export}</Export-Package>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>${lifecycle-mapping.version}</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.glassfish.build
                                        </groupId>
                                        <artifactId>
                                            spec-version-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [1.2,)
                                        </versionRange>
                                        <goals>
                                            <goal>
                                                set-spec-properties
                                            </goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

</project>
