<?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</groupId>
        <artifactId>smallrye-graphql-server-parent</artifactId>
        <version>2.13.0</version>
    </parent>
    
    <artifactId>smallrye-graphql-cdi</artifactId>
    <name>SmallRye: GraphQL Server :: CDI</name>
    <description>Allow lookup up of GraphQL Beans via CDI</description>
    
    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>smallrye-graphql</artifactId>
        </dependency>
        
        <dependency>
            <groupId>jakarta.enterprise</groupId>
            <artifactId>jakarta.enterprise.cdi-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.microprofile.metrics</groupId>
            <artifactId>microprofile-metrics-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.microprofile.config</groupId>
            <artifactId>microprofile-config-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.microprofile.context-propagation</groupId>
            <artifactId>microprofile-context-propagation-api</artifactId>
            <scope>provided</scope>
        </dependency>
        
        <!-- Logging -->
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- OpenTelemetry -->
        <dependency>
            <groupId>io.smallrye.opentelemetry</groupId>
            <artifactId>smallrye-opentelemetry-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Validation -->
        <dependency>
            <groupId>jakarta.validation</groupId>
            <artifactId>jakarta.validation-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>jakarta.json</groupId>
            <artifactId>jakarta.json-api</artifactId>
        </dependency>

        <!-- Testing -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse</groupId>
            <artifactId>yasson</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.weld</groupId>
            <artifactId>weld-junit5</artifactId>
            <version>${version.weld-junit5}</version>
            <scope>test</scope>
        </dependency>
<!--        <dependency>-->
<!--            <groupId>org.jboss.weld.se</groupId>-->
<!--            <artifactId>weld-se-core</artifactId>-->
<!--            <version>5.1.0.Final</version>-->
<!--            <scope>test</scope>-->
<!--        </dependency>-->
        <dependency>
            <groupId>io.smallrye.reactive</groupId>
            <artifactId>mutiny</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.smallrye.config</groupId>
            <artifactId>smallrye-config</artifactId>
            <scope>test</scope>
        </dependency>
        
        <!-- The model builder -->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>smallrye-graphql-schema-builder</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <useFile>false</useFile>
                    <trimStackTrace>false</trimStackTrace>
                </configuration>
            </plugin>
        </plugins>
    </build>
    
    <profiles>
        
        <!-- Run against the current released version -->
        <profile>
            <id>v2.0.x</id>
            <activation>
                <property>
                    <name>!version.eclipse.microprofile.graphql</name>
                </property>
            </activation>
            
            <dependencies>
                <dependency>
                    <groupId>org.eclipse.microprofile.graphql</groupId>
                    <artifactId>microprofile-graphql-tck</artifactId>
                    <type>jar</type>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
            
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>3.3.0</version>
                        <executions>
                            <execution>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
                                    <excludes>**/tests/,**/dynamic/,**/*Test.class,**/beans.xml,**/*.properties</excludes>
                    
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.eclipse.microprofile.graphql</groupId>
                                            <artifactId>microprofile-graphql-tck</artifactId>
                                            <type>jar</type>
                                        </artifactItem>        
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                        
                    </plugin>
                </plugins>
            </build>
        </profile>
        
        <!-- Run against the snapshot version -->
        <profile>
            <id>v2.1-SNAPSHOT</id>
            <activation>
                <property>
                    <name>version.eclipse.microprofile.graphql</name>
                    <value>2.1-SNAPSHOT</value>
                </property>
            </activation>
            
            <dependencies>
                <dependency>
                   <groupId>org.eclipse.microprofile.graphql</groupId>
                    <artifactId>microprofile-graphql-server-tck</artifactId>
                    <type>jar</type>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
            
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>3.3.0</version>
                        <executions>
                            <execution>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
                                    <excludes>**/tests/,**/dynamic/,**/*Test.class,**/beans.xml</excludes>
                    
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.eclipse.microprofile.graphql</groupId>
                                            <artifactId>microprofile-graphql-server-tck</artifactId>
                                            <type>jar</type>
                                        </artifactItem>        
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                        
                    </plugin>
                </plugins>
            </build>
        </profile>
        
        <profile>
            <id>coverage</id>
            <properties>
                <argLine>@{jacocoArgLine}</argLine>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
