<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 2012, 2026 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Distribution License v. 1.0, which is available at
    http://www.eclipse.org/org/documents/edl-v10.php.

    SPDX-License-Identifier: BSD-3-Clause

-->

<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>org.glassfish.jersey.examples</groupId>
        <artifactId>webapp-example-parent</artifactId>
        <relativePath>../webapp-example-parent/pom.xml</relativePath>
        <version>3.1.12</version>
    </parent>

    <artifactId>extended-wadl-webapp</artifactId>
    <name>jersey-examples-extended-wadl-webapp</name>
    <packaging>war</packaging>

    <description>Extended WADL example.</description>

    <dependencies>
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-server</artifactId>
        </dependency>
        <dependency>
            <!-- Extended Wadl Config: Dependency to jersey-wadl-doclet is needed here to keep the correct build order. -->
            <groupId>org.glassfish.jersey.ext</groupId>
            <artifactId>jersey-wadl-doclet</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.inject</groupId>
            <artifactId>jersey-hk2</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.validation</groupId>
            <artifactId>jakarta.validation-api</artifactId>
        </dependency>

        <dependency>
            <groupId>org.glassfish.jersey.containers</groupId>
            <artifactId>jersey-container-grizzly2-servlet</artifactId>
        </dependency>

        <!-- Pax-Exam and JUnit dependencies -->
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-junit4</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-container-forked</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-junit-extender-impl</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.tinybundles</groupId>
            <artifactId>tinybundles</artifactId>
            <scope>test</scope>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-link-mvn</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit4.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- OSGi runtime - Felix -->
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.framework</artifactId>
            <scope>test</scope>
        </dependency>


        <!-- logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-reload4j</artifactId>
            <version>${slf4j.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.codehaus.jettison</groupId>
            <artifactId>jettison</artifactId>
        </dependency>

        <dependency>
            <groupId>org.glassfish.hk2.external</groupId>
            <artifactId>aopalliance-repackaged</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.javassist</groupId>
            <artifactId>javassist</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-osgi</artifactId>
<!--            <scope>test</scope>-->
        </dependency>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.angus</groupId>
            <artifactId>angus-activation</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Extended Wadl Config: this plugin generates the jaxb beans from xsd schemas -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxb2-maven-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>xjc</id>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <sources>
                        <source>src/main/xsd</source>
                    </sources>
                    <packageName>org.glassfish.jersey.examples.extendedwadl</packageName>
                    <extension>true</extension>
                    <strict>false</strict>
                    <verbose>true</verbose>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.glassfish.jaxb</groupId>
                        <artifactId>jaxb-xjc</artifactId>
                        <version>${jaxb.ri.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>jakarta.activation</groupId>
                        <artifactId>jakarta.activation-api</artifactId>
                        <version>${jakarta.activation-api.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>jakarta.xml.bind</groupId>
                        <artifactId>jakarta.xml.bind-api</artifactId>
                        <version>${jakarta.jaxb.api.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>com.sun.xml.bind</groupId>
                        <artifactId>jaxb-impl</artifactId>
                        <version>${jaxb.ri.version}</version>
                    </dependency>

                </dependencies>
            </plugin>

            <!-- Extended Wadl Config: javadoc plugin generates resourcedoc.xml during the compilation using doclet.
            Generated file is then used during runtime to attach javadoc information to wadl. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>javadoc</goal>
                        </goals>
                        <phase>process-classes</phase>
                    </execution>
                </executions>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <verbose>false</verbose>
                    <show>public</show>
                    <subpackages>org.glassfish.jersey.examples.extendedwadl</subpackages>
                    <doclet>org.glassfish.jersey.wadl.doclet.ResourceDoclet</doclet>
                    <docletPath>${path.separator}${project.build.outputDirectory}</docletPath>
                    <docletArtifacts>
                        <!-- jersey doclet generator -->
                        <docletArtifact>
                            <groupId>org.glassfish.jersey.ext</groupId>
                            <artifactId>jersey-wadl-doclet</artifactId>
                            <version>${project.version}</version>
                        </docletArtifact>
                        <!--
                            Also specify jersey and xerces as doclet artifacts as the ResourceDoclet
                            uses classes provided by them to generate the resourcedoc.
                         -->
                        <docletArtifact>
                            <groupId>org.glassfish.jersey.core</groupId>
                            <artifactId>jersey-server</artifactId>
                            <version>${project.version}</version>
                        </docletArtifact>
                        <docletArtifact>
                            <groupId>xerces</groupId>
                            <artifactId>xercesImpl</artifactId>
                            <version>${xerces.version}</version>
                        </docletArtifact>
                        <docletArtifact>
                            <groupId>xml-apis</groupId>
                            <artifactId>xml-apis</artifactId>
                            <version>1.4.01</version>
                        </docletArtifact>
                        <docletArtifact>
                            <groupId>jakarta.xml.bind</groupId>
                            <artifactId>jakarta.xml.bind-api</artifactId>
                            <version>${jakarta.jaxb.api.version}</version>
                        </docletArtifact>
                    </docletArtifacts>
                    <!-- the following option is required as a work around for
                         version 2.5 of the javadoc plugin which will be used
                         by a maven version > 2.0.9 -->
                    <useStandardDocletOptions>false</useStandardDocletOptions>
                    <additionalOptions>
                        <additionalOption>-output ${project.build.outputDirectory}/resourcedoc.xml</additionalOption>
                    </additionalOptions>
                    <doclint>none</doclint>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <forkCount>1</forkCount>
                    <reuseForks>false</reuseForks>
                    <enableAssertions>false</enableAssertions>
                    <excludes>
                        <exclude>org/glassfish/jersey/examples/extendedwadl/ExtendedWadlWebappOsgiTest.java</exclude>
                    </excludes>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit47</artifactId>
                        <version>${surefire.mvn.plugin.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.ops4j.pax.exam</groupId>
                <artifactId>maven-paxexam-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <configuration>
                    <mainClass>org.glassfish.jersey.examples.extendedwadl.App</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>javadocAndTestsSkipJDK13</id>
            <activation>
                <jdk>[13,)</jdk>
            </activation>
            <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <configuration>
                        <skip>true</skip>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <skip>true</skip>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <executions>
                        <execution>
                            <phase>generate-resources</phase>
                            <goals>
                                <goal>run</goal>
                            </goals>
                            <configuration>
                                <target>
                                    <echo>****************************************************</echo>
                                    <echo>****THIS EXAMPLE WORKS ONLY ON JDKs PRIOR to 13!****</echo>
                                    <echo>********CURRENT JDK IS NOT SUPPORTED!***************</echo>
                                    <echo>****************************************************</echo>
                                </target>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.jvnet.jaxb2.maven2</groupId>
                    <artifactId>maven-jaxb2-plugin</artifactId>
                    <version>0.14.0</version>
                    <configuration>
                        <verbose>false</verbose>
                    </configuration>
                </plugin>
            </plugins>
            </build>
        </profile>
        <profile>
            <id>pre-release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>xml-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>transform-gf-pom</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>transform</goal>
                                </goals>
                                <configuration>
                                    <transformationSets>
                                        <transformationSet>
                                            <dir>${project.build.directory}/gf-pom-file</dir>
                                            <includes>
                                                <include>pom.xml</include>
                                            </includes>
                                            <stylesheet>src/main/xslt/gf.xsl</stylesheet>
                                            <outputDir>${project.build.directory}/gf-pom-file</outputDir>
                                        </transformationSet>
                                    </transformationSets>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>sonar</id>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-surefire-plugin</artifactId>
                            <configuration>
                                <!-- disable JaCoCo listener because it's not working with <forkMode>always</fork> (<reuseForks>false</reuseForks> respectively)
                                https://jira.sonarsource.com/browse/SONARJAVA-728 (https://github.com/SonarSource/sonar-java/pull/324) -->
                                <properties combine.self="override" />
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
    </profiles>
</project>
