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

    Copyright (c) 2012, 2022 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>jakarta.enterprise.concurrent</groupId>
    	<artifactId>jakarta.enterprise.concurrent.parent</artifactId>
        <version>3.0.0</version>
    </parent>
    
    <artifactId>jakarta.enterprise.concurrent-api</artifactId>
    
    <name>Jakarta Concurrency</name>
    <description>Jakarta Concurrency API Module</description>

    <properties>

        <api_package>jakarta.enterprise.concurrent</api_package>
        <non.final>false</non.final> <!-- switch back to true once release is completed -->
        <last.spec_version>2.0</last.spec_version>
        <next.spec_version>3.0</next.spec_version>
        <spec.version>${next.spec_version}</spec.version>
        <new.spec.version>3.1</new.spec.version>
        <build_number />
        <packages.export>jakarta.enterprise.concurrent.*; version=${spec.bundle.version}</packages.export>
    </properties>

    <build>
        <plugins>
            <!-- 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>${spec.version}</specVersion>
                        <specImplVersion>3.0.0</specImplVersion>
                        <apiPackage>${api_package}</apiPackage>
                        
                        <nonFinal>${non.final}</nonFinal>
                        <newSpecVersion>${new.spec.version}</newSpecVersion>
                        <specBuild>${build_number}</specBuild>
                    </spec>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>set-spec-properties</goal>
                            <goal>check-module</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>
                <version>3.0.1</version>
                <extensions>true</extensions>
                <configuration>
                    <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>
                        <specversion>${spec.specification.version}</specversion>
                        <Export-Package>${packages.export}</Export-Package>
                    </instructions>
                </configuration>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <useDefaultManifestFile>true</useDefaultManifestFile>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <configuration>
                    <format>{0,date,MM/dd/yyyy hh:mm aa}</format>
                    <items>
                        <item>timestamp</item>
                    </items>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.3.1</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultEntries>false</addDefaultEntries>
                        </manifest>
                    </archive>
                    <source>11</source>
                    <doclint>none</doclint>
                    <notimestamp>true</notimestamp>
                    <docfilessubdirs>true</docfilessubdirs>
                    <quiet>true</quiet>
                    <header><![CDATA[<br>Jakarta Concurrency API v${project.version}]]></header>
                    <bottom>
<![CDATA[Copyright (c) 2020, 2022 Eclipse Foundation.
    Use is subject to
    <a href="{@docRoot}/doc-files/speclicense.html" target="_top">license terms</a>.
]]>
                    </bottom>
                    <groups>
                        <group>
                            <title>Jakarta(tm) Concurrency API Documentation</title>
                            <packages>jakarta.enterprise.concurrent</packages>
                        </group>
                    </groups>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>add-resource</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>add-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>..</directory>
                                    <targetPath>META-INF</targetPath>
                                    <includes>
                                        <include>LICENSE.md</include>
                                        <include>NOTICE.md</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>jxr</goal>
                        </goals>
                        <phase>validate</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.1.2</version>
                <configuration>
                    <outputDirectory>${project.build.directory}/checkstyle</outputDirectory>
                    <outputFile>${project.build.directory}/checkstyle/checkstyle-result.xml</outputFile>
                    <configLocation>etc/config/checkstyle.xml</configLocation>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>checkstyle</goal>
                        </goals>
                        <phase>validate</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
