<?xml version="1.0" encoding="UTF-8"?>
<!--

  Copyright (c) [2017-2022] Payara Foundation and/or its affiliates. All rights reserved.

  The contents of this file are subject to the terms of either the GNU
  General Public License Version 2 only ("GPL") or the Common Development
  and Distribution License("CDDL") (collectively, the "License").  You
  may not use this file except in compliance with the License.  You can
  obtain a copy of the License at
  https://github.com/payara/Payara/blob/master/LICENSE.txt
  See the License for the specific
  language governing permissions and limitations under the License.

  When distributing the software, include this License Header Notice in each
  file and include the License file at glassfish/legal/LICENSE.txt.

  GPL Classpath Exception:
  The Payara Foundation designates this particular file as subject to the "Classpath"
  exception as provided by the Payara Foundation in the GPL Version 2 section of the License
  file that accompanied this code.

  Modifications:
  If applicable, add the following below the License Header, with the fields
  enclosed by brackets [] replaced by your own identifying information:
  "Portions Copyright [year] [name of copyright owner]"

  Contributor(s):
  If you wish your version of this file to be governed by only the CDDL or
  only the GPL Version 2, indicate your decision by adding "[Contributor]
  elects to include this software in this distribution under the [CDDL or GPL
  Version 2] license."  If you don't indicate a single choice of license, a
  recipient has the option to distribute your version of this file under
  either the CDDL, the GPL Version 2 or to extend the choice of license to
  its licensees as provided above.  However, if you add GPL Version 2 code
  and therefore, elected the GPL Version 2 license, then the option applies
  only if the new code is made subject to such option by the copyright
  holder.


  This file incorporates work covered by the following copyright and
  permission notice:

  JBoss, Home of Professional Open Source
  Copyright 2011, Red Hat Middleware LLC, and individual contributors
  by the @authors tag. See the copyright.txt in the distribution for a
  full listing of individual contributors.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

-->
<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>fish.payara.arquillian</groupId>
    <artifactId>parent-payara-containers</artifactId>
    <version>3.0</version>
    <packaging>pom</packaging>

    <name>Arquillian Container Parent Payara</name>

    <description>
        Payara Container integrations for the Arquillian Project.
        Based on the JBoss GlassFish container integrations.
    </description>

    <url>https://github.com/payara/Payara</url>

    <properties>
        <version.arquillian_core>1.8.0.Final</version.arquillian_core>
        <version.jersey>3.1.0-M5</version.jersey>
        <version.jakartaee>10</version.jakartaee>
        <version.jakartaee.api>10.0.0</version.jakartaee.api>
        <version.maven.surefire.plugin>3.0.0-M5</version.maven.surefire.plugin>
        <version.maven.source.plugin>3.2.1</version.maven.source.plugin>
        <version.maven.jar.plugin>3.2.0</version.maven.jar.plugin>
        <version.maven.gpg.plugin>3.0.1</version.maven.gpg.plugin>
        <version.maven.javadoc.plugin>3.3.1</version.maven.javadoc.plugin>
        <version.maven.shade.plugin>3.3.0</version.maven.shade.plugin>
        <version.maven.enforcer.plugin>3.0.0</version.maven.enforcer.plugin>
        <version.maven.deploy.plugin>3.0.0-M1</version.maven.deploy.plugin>
        <version.microprofile.fault-tolerance>4.0</version.microprofile.fault-tolerance>

        <version.java>11</version.java>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.target>11</maven.compiler.target>
        <maven.compiler.source>11</maven.compiler.source>
        <version.maven.enforcer.java.limit>12</version.maven.enforcer.java.limit>
        <docs.phase>deploy</docs.phase>

        <version.payara>6.2022.1.Alpha2</version.payara>
        <payara.home>payara6</payara.home>

        <gpg.keyname>Payara-CI</gpg.keyname>
    </properties>

    <scm>
        <connection>scm:git:git@github.com:payara/ecosystem-arquillian-connectors.git</connection>
        <url>scm:git:git@github.com:payara/ecosystem-arquillian-connectors.git</url>
        <developerConnection>scm:git:git@github.com:payara/ecosystem-arquillian-connectors.git</developerConnection>
        <tag>${project.version}</tag>
    </scm>

    <licenses>
        <license>
            <name>CDDL + GPLv2 with classpath exception</name>
            <url>http://glassfish.java.net/nonav/public/CDDL+GPL.html</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Payara Team</name>
            <email>info@payara.fish</email>
            <organization>Payara Foundation</organization>
            <organizationUrl>http://www.payara.fish</organizationUrl>
        </developer>
    </developers>

    <repositories>
        <!-- Try Maven central first, not last, which happens when omitted here -->
        <repository>
            <id>payara-maven-central</id>
            <name>Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>

        <repository>
            <id>payara-patched-externals</id>
            <name>Payara Patched Externals</name>
            <url>https://raw.github.com/payara/Payara_PatchedProjects/master</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>

        <repository>
            <id>payara-nexus-artifacts</id>
            <name>Payara Patched Artifacts</name>
            <url>https://nexus.dev.payara.fish/repository/payara-artifacts</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>

        <!-- Temporal for Jakarta EE 10 development until the jar files are available on maven central -->
        <repository>
            <id>staged-jakarta-releases</id>
            <url>https://jakarta.oss.sonatype.org/content/groups/staging/</url>
        </repository>

    </repositories>

    <modules>
        <module>payara-common</module>
        <module>payara-managed</module>
        <module>payara-remote</module>
        <module>payara-embedded</module>
        <module>payara-micro</module>
        <module>payara-client-ee9</module>
        <module>payara-micro-deployer</module>
        <module>payara-micro-remote</module>
        <module>environment-setup</module>
        <module>integration-tests</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.glassfish.jersey.core</groupId>
                <artifactId>jersey-client</artifactId>
                <version>${version.jersey}</version>
            </dependency>

            <dependency>
                <groupId>org.glassfish.jersey.inject</groupId>
                <artifactId>jersey-hk2</artifactId>
                <version>${version.jersey}</version>
            </dependency>

            <dependency>
                <groupId>org.glassfish.jersey.ext</groupId>
                <artifactId>jersey-proxy-client</artifactId>
                <version>${version.jersey}</version>
            </dependency>

            <dependency>
                <groupId>org.glassfish.jersey.ext</groupId>
                <artifactId>jersey-microprofile-rest-client</artifactId>
                <version>${version.jersey}</version>
            </dependency>

            <dependency>
                <groupId>org.glassfish.jersey.core</groupId>
                <artifactId>jersey-common</artifactId>
                <version>${version.jersey}</version>
            </dependency>

            <dependency>
                <groupId>org.glassfish.jersey.core</groupId>
                <artifactId>jersey-server</artifactId>
                <version>${version.jersey}</version>
            </dependency>

            <dependency>
                <groupId>org.glassfish.jersey.media</groupId>
                <artifactId>jersey-media-sse</artifactId>
                <version>${version.jersey}</version>
            </dependency>

            <dependency>
                <groupId>org.glassfish.jersey.media</groupId>
                <artifactId>jersey-media-multipart</artifactId>
                <version>${version.jersey}</version>
            </dependency>

            <dependency>
                <groupId>org.glassfish.jersey.media</groupId>
                <artifactId>jersey-media-jaxb</artifactId>
                <version>${version.jersey}</version>
            </dependency>

            <dependency>
                <groupId>org.glassfish.jersey.media</groupId>
                <artifactId>jersey-media-json-processing</artifactId>
                <version>${version.jersey}</version>
            </dependency>

            <dependency>
                <groupId>org.glassfish.jersey.media</groupId>
                <artifactId>jersey-media-json-jackson</artifactId>
                <version>${version.jersey}</version>
            </dependency>

            <dependency>
                <groupId>jakarta.platform</groupId>
                <artifactId>jakarta.jakartaee-api</artifactId>
                <version>${version.jakartaee.api}</version>
            </dependency>

            <dependency>
                <groupId>org.jboss.arquillian</groupId>
                <artifactId>arquillian-bom</artifactId>
                <version>${version.arquillian_core}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.jboss.arquillian</groupId>
                <artifactId>arquillian-build</artifactId>
                <version>${version.arquillian_core}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.eclipse.microprofile.fault-tolerance</groupId>
                <artifactId>microprofile-fault-tolerance-api</artifactId>
                <version>${version.microprofile.fault-tolerance}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <!-- Configure the jar with the binaries. -->
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${version.maven.jar.plugin}</version>
                <configuration>
                    <forceCreation>true</forceCreation>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                        <manifestEntries>
                            <URL>${project.url}</URL>
                            <Extension-Name>${project.artifactId}</Extension-Name>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <!-- Configure the jar with the sources. -->
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>${version.maven.source.plugin}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>${docs.phase}</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Configure the jar with the javadoc. -->
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${version.maven.javadoc.plugin}</version>
                <configuration>
                    <javadocVersion>${version.java}</javadocVersion>
                    <notimestamp>true</notimestamp>
                    <splitindex>true</splitindex>
                    <doctitle>Arquillian connector</doctitle>
                    <links>
                        <!-- Jakarta EE 10 apidocs not available yet, point to 9.1 for now -->
                        <!--<link>https://jakarta.ee/specifications/platform/${version.jakartaee}/apidocs/</link>-->
                        <link>https://jakarta.ee/specifications/platform/9.1/apidocs/</link>
                    </links>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <phase>${docs.phase}</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${version.maven.deploy.plugin}</version>
                <executions>
                    <execution>
                        <id>default-deploy</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>deploy</id>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <pushChanges>false</pushChanges>
                    <localCheckout>true</localCheckout>
                    <releaseProfiles>release</releaseProfiles>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>enforce-java</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>[${version.java},${version.maven.enforcer.java.limit})</version>
                                    <message>JDK8 only please</message>
                                </requireJavaVersion>
                                <requireMavenVersion>
                                    <version>3.6</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
        <pluginManagement>
            <plugins>

                <plugin>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${version.maven.shade.plugin}</version>
                    <executions>
                        <execution>
                            <id>shade</id>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                            <configuration>
                                <artifactSet>
                                    <includes>
                                        <include>*</include>
                                    </includes>
                                    <excludes>
                                        <exclude>org.jboss*:*</exclude>
                                        <exclude>fish.payara.arquillian:*-common</exclude>
                                    </excludes>
                                </artifactSet>
                            </configuration>
                        </execution>
                    </executions>
                  <configuration>
                    <createDependencyReducedPom>false</createDependencyReducedPom>
                    <transformers>
                      <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                      <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
                    </transformers>

                    <relocations>
                      <relocation>
                        <pattern>jakarta.</pattern>
                        <shadedPattern>fish.payara.arquillian.shaded.jakarta.</shadedPattern>
                        <excludes>
                          <!-- we don't depend on activation, but Jersey refers to it -->
                          <exclude>jakarta.activation.*</exclude>
                          <!-- we require original class for exception translation -->
                          <exclude>**.inject.spi.Deployment*</exclude>
                          <exclude>**.inject.spi.Definition*</exclude>
                        </excludes>
                      </relocation>
                      <relocation>
                        <pattern>javassist.</pattern>
                        <shadedPattern>fish.payara.arquillian.shaded.javassist.</shadedPattern>
                      </relocation>
                      <relocation>
                        <pattern>org.</pattern>
                        <shadedPattern>fish.payara.arquillian.shaded.</shadedPattern>
                        <excludes>
                          <exclude>org.jboss.**</exclude>
                          <exclude>org.w3c.**</exclude>
                          <exclude>org.omg.**</exclude>
                          <exclude>org.ietf.**</exclude>
                          <exclude>org.xml.**</exclude>
                          <!-- we require original class for exception translation -->
                          <exclude>**.faulttolerance.**</exclude>
                        </excludes>
                      </relocation>
                    </relocations>
                  </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <properties>
                <docs.phase>package</docs.phase>
            </properties>
            <build>
                <plugins>
                    <!-- Signing with GPG is a requirement for a release deployment to Maven central. -->
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${version.maven.gpg.plugin}</version>
                        <configuration>
                            <keyname>${gpg.keyname}</keyname>
                            <passphraseServerId>${gpg.keyname}</passphraseServerId>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>payara-enterprise</id>
            <properties>
                <version.payara>5.31.0</version.payara>
            </properties>
            <distributionManagement>
                <repository>
                    <id>payara-enterprise</id>
                    <name>Payara Enterprise Nexus</name>
                    <url>https://nexus.dev.payara.fish/content/repositories/payara-enterprise/</url>
                </repository>
            </distributionManagement>
            <repositories>
                <repository>
                    <id>payara-enterprise</id>
                    <name>Payara Enterprise Nexus</name>
                    <url>https://nexus.dev.payara.fish/content/repositories/payara-enterprise/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>
            </repositories>
        </profile>
        <profile>
            <id>payara-community</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <distributionManagement>
                <snapshotRepository>
                    <id>payara-maven-central</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
                <repository>
                    <id>payara-maven-central</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>payara-maven-central</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>skipTests</id>
            <activation>
                <property>
                    <name>skipTests</name>
                    <value>true</value>
                </property>
            </activation>
            <properties>
                <maven.test.skip>true</maven.test.skip>
                <skipITs>true</skipITs>
            </properties>
        </profile>
    </profiles>
</project>
