<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You 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">
    <parent>
        <artifactId>tck</artifactId>
        <groupId>org.apache.tomee</groupId>
        <version>10.1.5</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>jsonp-standalone</artifactId>
    <name>TomEE :: TCK :: JSON-P Standalone</name>

    <dependencies>
        <dependency>
            <groupId>org.apache.tomee</groupId>
            <artifactId>jakartaee-api</artifactId>
        </dependency>

        <dependency>
            <groupId>jakarta.json</groupId>
            <artifactId>jakarta.json-tck-tests</artifactId>
            <version>${jsonp-tck.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>jakarta.json</groupId>
            <artifactId>jakarta.json-tck-tests-pluggability</artifactId>
            <version>${jsonp-tck.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.johnzon</groupId>
            <artifactId>johnzon-core</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.openwebbeans</groupId>
            <artifactId>openwebbeans-se</artifactId>
            <version>${version.openwebbeans}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.openwebbeans</groupId>
            <artifactId>openwebbeans-impl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.openwebbeans</groupId>
            <artifactId>openwebbeans-spi</artifactId>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>tck-jsonp</id>
            <build>
                <testResources>
                    <testResource>
                        <directory>src/test/resources</directory>
                        <filtering>true</filtering>
                    </testResource>
                </testResources>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${surefire.version}</version>
                        <configuration>
                            <reuseForks>false</reuseForks>
                            <forkCount>1</forkCount>
                        </configuration>

                        <!-- Pluggability tests need to be run separately from normal TCKs as they bring their
                             own JsonProvider implementation which would break other TCK tests -->
                        <executions>
                            <execution>
                                <id>tck-pluggability</id>

                                <goals>
                                    <goal>test</goal>
                                </goals>

                                <configuration>
                                    <dependenciesToScan>jakarta.json:jakarta.json-tck-tests-pluggability
                                    </dependenciesToScan>

                                    <classpathDependencyExcludes>
                                        <classpathDependencyExclude>jakarta.json:jakarta.json-tck-tests
                                        </classpathDependencyExclude>
                                    </classpathDependencyExcludes>
                                </configuration>

                            </execution>

                            <execution>
                                <id>tck</id>

                                <goals>
                                    <goal>test</goal>
                                </goals>

                                <configuration>
                                    <dependenciesToScan>jakarta.json:jakarta.json-tck-tests</dependenciesToScan>

                                    <classpathDependencyExcludes>
                                        <classpathDependencyExclude>jakarta.json:jakarta.json-tck-tests-pluggability
                                        </classpathDependencyExclude>
                                    </classpathDependencyExcludes>

                                    <excludes>
                                        <exclude>**/JSONPSigTest</exclude>
                                    </excludes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>