<?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.quarkiverse.cxf</groupId>
        <artifactId>quarkus-cxf-integration-tests</artifactId>
        <version>3.37.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>quarkus-cxf-integration-test-client-server</artifactId>

    <name>Quarkus CXF - Integration Test - Client and server</name>
    <description>CXF client and server in the same application</description>

    <dependencies>
        <dependency>
            <groupId>io.quarkiverse.cxf</groupId>
            <artifactId>quarkus-cxf</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-elytron-security-properties-file</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-rest</artifactId>
        </dependency>

        <dependency>
            <groupId>io.quarkiverse.cxf</groupId>
            <artifactId>quarkus-cxf-test-util</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkiverse.cxf</groupId>
            <artifactId>quarkus-cxf-test-util-internal</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.smallrye.certs</groupId>
            <artifactId>smallrye-certificate-generator</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-maven-plugin</artifactId>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate-code</goal>
                            <goal>build</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <sources>
                                <source>target/generated-sources/wsdl2java-extensors</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <!-- Copy the sample code to docs module where Antora can see it -->
                        <id>copy-resources-for-antora</id>
                        <!-- after source formatting -->
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <phase>compile</phase>
                        <configuration>
                            <outputDirectory>${maven.multiModuleProjectDirectory}/docs/modules/ROOT/examples/client-server</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/main/resources</directory>
                                    <includes>
                                        <include>application.properties</include>
                                    </includes>
                                </resource>
                                <resource>
                                    <directory>src/main/java/io/quarkiverse/cxf/it/auth/basic</directory>
                                    <includes>
                                        <include>BasicAuthHelloServiceImpl.java</include>
                                    </includes>
                                </resource>
                                <resource>
                                    <directory>src/main/java/io/quarkiverse/cxf/it/annotation/cxfendpoint</directory>
                                    <includes>
                                        <include>PathAnnotationHelloServiceImpl.java</include>
                                    </includes>
                                </resource>
                                <resource>
                                    <directory>src/test/java/io/quarkiverse/cxf/it/annotation/cxfendpoint</directory>
                                    <includes>
                                        <include>MockedEndpointTest.java</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>native</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <quarkus.package.type>native</quarkus.package.type>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                                <configuration>
                                    <systemPropertyVariables>
                                        <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>virtualDependencies</id>
            <activation>
                <property>
                    <name>!noVirtualDependencies</name>
                </property>
            </activation>
            <dependencies>
                <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
                <dependency>
                    <groupId>io.quarkiverse.cxf</groupId>
                    <artifactId>quarkus-cxf-deployment</artifactId>
                    <version>${project.version}</version>
                    <type>pom</type>
                    <scope>test</scope>
                    <exclusions>
                        <exclusion>
                            <groupId>*</groupId>
                            <artifactId>*</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

</project>
