<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>io.quarkiverse</groupId>
        <artifactId>quarkiverse-parent</artifactId>
        <version>10</version>
    </parent>

    <groupId>io.quarkiverse.cxf</groupId>
    <artifactId>quarkus-cxf-parent</artifactId>
    <version>1.5.9</version>
    <name>Quarkus CXF - Parent</name>

    <packaging>pom</packaging>

    <url>https://github.com/quarkiverse/quarkiverse-cxf</url>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>dufoli</id>
            <name>Olivier Dufour</name>
            <email>olivier dot duff at gmail(DOT)com</email>
        </developer>
        <developer>
            <id>dufgui</id>
            <name>Guillaume Dufour</name>
        </developer>
        <developer>
            <id>shumonsharif</id>
            <name>Shumon Sharif</name>
            <email>shumon.sharif@gmail.com</email>
        </developer>
    </developers>
    <properties>
        <!-- Compile dependency versions (keep sorted alphabetically) -->
        <!-- Items annotated with @sync can be updated by running mvn cq:sync-versions -N -->
        <assertj.version>3.23.1</assertj.version>
        <cxf.version>3.5.3</cxf.version>
        <cxf.xjc-utils.version>3.3.2</cxf.xjc-utils.version><!-- @sync org.apache.cxf:cxf:${cxf.version} prop:cxf.xjc-utils.version -->
        <ehcache.version>3.10.8</ehcache.version>
        <neethi.version>3.2.0</neethi.version>
        <mimepull.version>1.9.14</mimepull.version>
        <quarkus.version>2.13.5.Final</quarkus.version>
        <quarkus-xmlsec.version>1.1.1</quarkus-xmlsec.version>
        <saaj-impl.version>1.5.3</saaj-impl.version>
        <woodstox-core.version>6.4.0</woodstox-core.version>

        <supported-maven.versions>[3.6.2,)</supported-maven.versions>

        <cq-maven-plugin.version>3.2.3</cq-maven-plugin.version>
        <groovy-maven-plugin.version>2.1.1</groovy-maven-plugin.version>
        <groovy.version>3.0.13</groovy.version>
        <maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version>
        <maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version>
        <keytool-maven-plugin.version>1.6</keytool-maven-plugin.version>
        <maven-idea-plugin.version>2.2.1</maven-idea-plugin.version>
        <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
        <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
        <maven-failsafe-plugin.version>2.22.2</maven-failsafe-plugin.version>
        <quarkus-platform-bom-plugin.version>0.0.51</quarkus-platform-bom-plugin.version>

        <!-- maven-compiler-plugin -->
        <maven.compiler.release>11</maven.compiler.release>

        <!-- maven-enforcer-plugin -->
        <enforce-non-deployment.skip>false</enforce-non-deployment.skip>

    </properties>

    <scm>
        <url>https://github.com/quarkiverse/quarkiverse-cxf</url>
        <connection>scm:git:https://github.com/quarkiverse/quarkiverse-cxf.git</connection>
        <developerConnection>scm:git:https://github.com/quarkiverse/quarkiverse-cxf.git</developerConnection>
        <tag>1.5.9</tag>
    </scm>

    <modules>
        <module>bom</module>
        <module>extensions</module>
        <module>docs</module>
        <module>bom-test</module>
        <module>test-util</module>
        <module>integration-tests</module>
    </modules>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.cxf</groupId>
                    <artifactId>cxf-codegen-plugin</artifactId>
                    <version>${cxf.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${maven-enforcer-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-eclipse-plugin</artifactId>
                    <version>${maven-eclipse-plugin.version}</version>
                    <configuration>
                        <downloadSources>true</downloadSources>
                        <downloadJavadocs>true</downloadJavadocs>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.gmaven</groupId>
                    <artifactId>groovy-maven-plugin</artifactId>
                    <version>${groovy-maven-plugin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.codehaus.groovy</groupId>
                            <artifactId>groovy-all</artifactId>
                            <version>${groovy.version}</version>
                            <type>pom</type>
                            <exclusions>
                                <exclusion>
                                    <!-- groovy-testng depends on testng 7.2.0 which is not on maven central -->
                                    <groupId>org.codehaus.groovy</groupId>
                                    <artifactId>groovy-testng</artifactId>
                                </exclusion>
                            </exclusions>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>keytool-maven-plugin</artifactId>
                    <version>${keytool-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-idea-plugin</artifactId>
                    <version>${maven-idea-plugin.version}</version>
                    <configuration>
                        <downloadSources>true</downloadSources>
                        <downloadJavadocs>true</downloadJavadocs>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <systemProperties>
                            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                        </systemProperties>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven-failsafe-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-extension-maven-plugin</artifactId>
                    <version>${quarkus.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>extension-descriptor</goal>
                            </goals>
                            <phase>compile</phase>
                            <configuration>
                                <deployment>${project.groupId}:${project.artifactId}-deployment:${project.version}
                                </deployment>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-maven-plugin</artifactId>
                    <version>${quarkus.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.l2x6.cq</groupId>
                    <artifactId>cq-maven-plugin</artifactId>
                    <version>${cq-maven-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <optimize>true</optimize>
                    <debug>true</debug>
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce</id>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>${maven.compiler.release}</version>
                                </requireJavaVersion>
                                <dependencyConvergence />
                                <requireMavenVersion>
                                    <version>${supported-maven.versions}</version>
                                </requireMavenVersion>
                                <bannedDependencies>
                                    <excludes>
                                        <exclude>org.apache.geronimo.javamail:geronimo-javamail_1.4_mail</exclude><!-- use com.sun.mail:jakarta.mail instead -->
                                        <exclude>org.apache.geronimo.specs:geronimo-jta*</exclude>
                                        <!-- Use Jakarta artifacts instead of JBoss specific ones -->
                                        <exclude>org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec</exclude>
                                        <exclude>org.jboss.spec.javax.annotation:jboss-annotations-api_1.3_spec</exclude>
                                        <exclude>org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec</exclude>
                                        <exclude>org.jboss.spec.javax.transaction:jboss-transaction-api_1.3_spec</exclude>
                                        <exclude>org.jboss.spec.javax.servlet:jboss-servlet-api_4.0_spec</exclude>
                                        <exclude>org.jboss.spec.javax.security.jacc:jboss-jacc-api_1.5_spec</exclude>
                                        <exclude>org.jboss.spec.javax.security.auth.message:jboss-jaspi-api_1.1_spec</exclude>
                                        <exclude>org.jboss.spec.javax.websocket:jboss-websocket-api_1.1_spec</exclude>
                                        <exclude>org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.2_spec</exclude>
                                        <exclude>org.jboss.spec.javax.el:jboss-el-api_3.0_spec</exclude>
                                        <!-- except for these 2 for now as most of the RESTEasy optional artifacts depend on them
                                        <exclude>org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.1_spec</exclude>
                                        <exclude>org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.3_spec</exclude>
                                        -->
                                        <exclude>jakarta.xml.bind:jakarta.xml.bind-api</exclude>
                                        <exclude>jakarta.ws.rs:jakarta.ws.rs-api</exclude>
                                        <!-- Exclude javax dependencies in favor of Jakarta -->
                                        <exclude>javax.activation:activation</exclude>
                                        <exclude>javax.activation:javax.activation-api</exclude>
                                        <exclude>javax.annotation:javax.annotation-api</exclude>
                                        <exclude>javax.enterprise:cdi-api</exclude>
                                        <exclude>javax.inject:javax.inject</exclude>
                                        <exclude>javax.json:javax.json-api</exclude>
                                        <exclude>javax.json.bind:javax.json.bind-api</exclude>
                                        <exclude>org.glassfish:javax.json</exclude>
                                        <exclude>org.glassfish:javax.el</exclude>
                                        <exclude>javax.persistence:javax.persistence-api</exclude>
                                        <exclude>javax.persistence:persistence-api</exclude>
                                        <exclude>javax.security.enterprise:javax.security.enterprise-api</exclude>
                                        <exclude>javax.servlet:servlet-api</exclude>
                                        <exclude>javax.servlet:javax.servlet-api</exclude>
                                        <exclude>javax.transaction:jta</exclude>
                                        <exclude>javax.transaction:javax.transaction-api</exclude>
                                        <exclude>javax.validation:validation-api</exclude>
                                        <exclude>javax.xml.bind:jaxb-api</exclude>
                                        <exclude>javax.websocket:javax.websocket-api</exclude>
                                        <exclude>javax.ws.rs:javax.ws.rs-api</exclude>
                                        <!-- Exclude jakarta.activation-api as the implementation contains it -->
                                        <exclude>jakarta.activation:jakarta.activation-api</exclude>
                                        <!-- use our jboss-logmanager -->
                                        <exclude>org.jboss.logging:jboss-logmanager</exclude>
                                        <exclude>org.jboss.logging:jboss-logging-jdk</exclude>
                                        <!-- We don't want all the API's in one jar-->
                                        <exclude>javax:javaee-api</exclude>
                                        <!-- Prevent incompatible config from coming in -->
                                        <exclude>org.wildfly.client:wildfly-client-config</exclude>
                                        <exclude>org.jboss.marshalling:jboss-marshalling-osgi</exclude>
                                        <exclude>org.jboss.spec.javax.servlet:jboss-servlet-api_3.1_spec</exclude>
                                        <!-- The API is packaged by the implementation-->
                                        <exclude>jakarta.json:jakarta.json-api</exclude>
                                        <!-- Ensure none of the deps use netty-all. This forces deps to use more fine grained netty artifacts -->
                                        <exclude>io.netty:netty-all</exclude>
                                        <!-- Ban jboss-logmanager, we use jboss-logmanager-embedded -->
                                        <exclude>org.jboss.logmanager:jboss-logmanager</exclude>
                                        <!-- Ban Log4J (use org.jboss.logmanager:log4j-jboss-logmanager instead) -->
                                        <exclude>log4j:log4j</exclude>
                                        <exclude>org.apache.logging.log4j:log4j-core</exclude>
                                        <exclude>org.apache.logging.log4j:log4j-slf4j-impl</exclude>
                                        <!-- Ban commons-logging (use org.jboss.logging:commons-logging-jboss-logging instead) -->
                                        <exclude>commons-logging:commons-logging</exclude>
                                        <exclude>commons-logging:commons-logging-api</exclude>
                                        <exclude>org.springframework:spring-jcl</exclude>
                                        <exclude>org.slf4j:jcl-over-slf4j</exclude>
                                        <!-- Ban SLF4j implementations (use org.jboss.slf4j:slf4j-jboss-logmanager instead) -->
                                        <exclude>org.jboss.slf4j:slf4j-jboss-logging</exclude>
                                        <exclude>org.slf4j:slf4j-simple</exclude>
                                        <exclude>org.slf4j:slf4j-nop</exclude>
                                        <exclude>org.slf4j:slf4j-jdk14</exclude>
                                        <exclude>org.slf4j:slf4j-log4j12</exclude>
                                        <exclude>org.slf4j:slf4j-log4j13</exclude>
                                        <!-- Ban Logback implementations -->
                                        <exclude>ch.qos.logback:logback-classic</exclude>
                                        <exclude>ch.qos.logback:logback-core</exclude>
                                        <exclude>ch.qos.logback:logback-access</exclude>
                                        <exclude>ch.qos.logback:logback</exclude>
                                        <exclude>org.osgi:org.osgi.annotation.versioning</exclude>
                                        <!-- Ban Spring Dependencies (since we have our own jars)-->
                                        <exclude>org.springframework:spring-core</exclude>
                                        <exclude>org.springframework:spring-beans</exclude>
                                        <exclude>org.springframework:spring-context</exclude>
                                        <exclude>org.springframework:spring-web</exclude>
                                        <exclude>org.springframework:spring-webmvc</exclude>
                                        <exclude>org.springframework.data:spring-data-jpa</exclude>
                                        <exclude>org.springframework.data:spring-data-commons</exclude>
                                        <exclude>org.springframework.security:spring-security-core</exclude>
                                        <exclude>org.springframework.boot:spring-boot</exclude>
                                        <!-- Ban checker-qual, we don't use Checker Framework -->
                                        <exclude>org.checkerframework:checker-qual</exclude>
                                        <!-- We use our own impl here, including this one causes problems-->
                                        <exclude>org.jboss.resteasy:resteasy-context-propagation</exclude>
                                        <exclude>com.google.android:annotations</exclude>
                                        <exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude>
                                        <!-- Includes its own copy of an old version of the servlet API-->
                                        <exclude>org.apache.tomcat.embed:tomcat-embed-core</exclude>
                                        <exclude>org.jboss.modules:jboss-modules</exclude>
                                        <!-- We prefer ByteBuddy where possible -->
                                        <exclude>org.javassist:javassist</exclude>
                                    </excludes>
                                </bannedDependencies>
                            </rules>
                        </configuration>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.gmaven</groupId>
                <artifactId>groovy-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>update-github-workflows</id>
                        <inherited>false</inherited>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <phase>validate</phase>
                        <configuration>
                            <source>
                                import java.nio.file.Files
                                import java.nio.file.Path
                                import java.nio.file.Paths

                                def buildYaml = '.github/workflows/build.yml'
                                def buildXmlPath = project.basedir.toPath().resolve(buildYaml)
                                def buildXmlSource = buildXmlPath.getText('UTF-8')
                                def pattern = java.util.regex.Pattern.compile('testModule: *\\[([^\\]]*)\\]')
                                def matcher = pattern.matcher(buildXmlSource)
                                if (!matcher.find()) {
                                    throw new IllegalStateException('Pattern ' + pattern + ' does not match ' + buildXmlPath)
                                }
                                def foundTestModules = matcher.group(1)

                                def expectedTestModules;
                                def iTestsDir = project.basedir.toPath().resolve('integration-tests')
                                try (java.util.stream.Stream files = Files.list(iTestsDir)) {
                                    expectedTestModules = files
                                        .filter(path -&gt; Files.isRegularFile(iTestsDir.resolve(path).resolve('pom.xml')))
                                        .map(Path::getFileName)
                                        .map(Path::toString)
                                        .sorted()
                                        .collect(java.util.stream.Collectors.joining(', '))
                                }
                                if (!foundTestModules.equals(expectedTestModules)) {
                                    println('Updating testModule attribute in ' + buildYaml + ':\n  old: ' + foundTestModules + '\n  new: '+expectedTestModules)
                                    def newSource = new StringBuilder()
                                    matcher.appendReplacement(newSource, 'testModule: ['+ expectedTestModules +']')
                                    matcher.appendTail(newSource)
                                    buildXmlPath.setText(newSource.toString(), 'UTF-8')
                                } else {
                                    println('testModule attribute in ' + buildYaml + ' is up to date')
                                }
                            </source>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
