<?xml version="1.0" encoding="UTF-8"?>
<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>io.smallrye.reactive</groupId>
        <artifactId>smallrye-reactive-streams-operators-project</artifactId>
        <version>0.3.1</version>
    </parent>

    <artifactId>smallrye-reactive-streams-operators</artifactId>

    <packaging>jar</packaging>

    <dependencies>
        <!-- logging -->
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>${log4j2.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${log4j2.version}</version>
        </dependency>
    </dependencies>

    <build>
        <defaultGoal>clean install</defaultGoal>

        <plugins>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>default-jar</id>
                        <configuration>
                            <archive>
                                <!-- Generate a jar INDEX.LIST -->
                                <index>true</index>
                                <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                                <manifestEntries>
                                    <Maven-Group-Id>${project.groupId}</Maven-Group-Id>
                                    <Maven-Artifact-Id>${project.artifactId}</Maven-Artifact-Id>
                                    <Maven-Version>${project.version}</Maven-Version>
                                </manifestEntries>
                            </archive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>biz.aQute.bnd</groupId>
                <artifactId>bnd-maven-plugin</artifactId>
                <version>4.1.0</version>

                <executions>
                    <execution>
                        <id>default-bnd-process</id>
                        <goals>
                            <goal>bnd-process</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <bnd><![CDATA[
          Import-Package: *
          Export-Package: io.smallrye.reactive.streams.spi, io.smallrye.reactive.streams
          Private-Package: io.smallrye.reactive.streams*
          ]]></bnd>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <excludes>
                                <exclude>**/tck/*</exclude>
                            </excludes>
                            <testNGArtifactName>none:none</testNGArtifactName>
                        </configuration>
                    </execution>
                    <execution>
                        <id>tck</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <includes>
                                <include>**/tck/ReactiveStreamsEngineImplTck</include>
                            </includes>
                            <excludes>
                                <exclude>**/me/escoffier/microprofile/streams/*</exclude>
                                <exclude>**/tck/SubscriberWhitebox*</exclude>
                            </excludes>
                            <junitArtifactName>none:none</junitArtifactName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>coverage</id>
            <properties>
                <argLine>@{jacocoArgLine}</argLine>
            </properties>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.8.2</version>
                        <executions>
                            <execution>
                                <id>prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                                <phase>generate-test-resources</phase>
                                <configuration>
                                    <destFile>${project.build.directory}/jacoco.exec</destFile>
                                    <propertyName>jacocoArgLine</propertyName>
                                    <append>true</append>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
