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

    Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v. 2.0, which is available at
    http://www.eclipse.org/legal/epl-2.0.

    This Source Code may also be made available under the following Secondary
    Licenses when the conditions for such availability set forth in the
    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
    version 2 with the GNU Classpath Exception, which is available at
    https://www.gnu.org/software/classpath/license.html.

    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

--><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>

    <groupId>jakarta.tck</groupId>
    <artifactId>jakarta.tck.websocket.user-guide-parent</artifactId>
    <version>2.2.0</version>
    <packaging>pom</packaging>

    <name>Eclipse Foundation Technology Compatibility Kit User's Guide Parent for Jakarta WebSocket for Jakarta EE, Release 2.2</name>

    <properties>
        <asciidoctorj.diagram.version>2.3.1</asciidoctorj.diagram.version>
        <asciidoctorj.maven.plugin.version>3.1.0</asciidoctorj.maven.plugin.version>
        <asciidoctorj.pdf.version>2.3.19</asciidoctorj.pdf.version>

        <!-- plugin versions -->
        <asciidoctorj.version>3.0.0</asciidoctorj.version>
        <doc.pdf>Jakarta-${jakarta.spec.name}-TCK-Users-Guide.pdf</doc.pdf>
        <freemarker.version>2.3.32</freemarker.version>
        <!-- the short name of the specification this user guide is for, eg: Platform, JsonB,... -->
        <jakarta.spec.name>SpecName</jakarta.spec.name>
        <jbake.maven.plugin.version>2.7.0-rc.7</jbake.maven.plugin.version>

        <maven.deploy.skip>true</maven.deploy.skip>
        <maven.site.skip>true</maven.site.skip>
        <project.build.commonResourcesDirectory>${project.build.directory}/common-resources</project.build.commonResourcesDirectory>

        <!-- status: DRAFT, BETA, etc., or blank for final -->
        <status>DRAFT</status>

        <ug.resources.version>2.2.0</ug.resources.version>
        <ug.staging.dir>${project.build.directory}/staging</ug.staging.dir>
    </properties>

    <build>
        <defaultGoal>package</defaultGoal>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.5.0</version>
                    <executions>
                        <execution>
                            <id>enforce-versions</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <phase>none</phase>
                            <configuration>
                                <rules>
                                    <requireJavaVersion>
                                        <version>[17,)</version>
                                        <message>You need JDK17 or newer</message>
                                    </requireJavaVersion>
                                    <requireMavenVersion>
                                        <version>[3.6.3,)</version>
                                        <message>You need Apache Maven 3.6.3 or newer</message>
                                    </requireMavenVersion>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.3.2</version>
                    <executions>
                        <execution>
                            <id>clean-toc</id>
                            <goals>
                                <goal>clean</goal>
                            </goals>
                            <phase>none</phase>
                            <configuration>
                                <filesets>
                                    <fileset>
                                        <directory>src/main/jbake/content</directory>
                                        <includes>
                                            <include>toc.adoc</include>
                                        </includes>
                                    </fileset>
                                </filesets>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.13</version>
                    <configuration>
                        <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        <!-- Skip based on the maven.deploy.skip property -->
                        <skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>3.7.1</version>
                    <executions>
                        <execution>
                            <id>build-dist</id>
                            <goals>
                                <goal>single</goal>
                            </goals>
                            <phase>none</phase>
                            <configuration>
                                <descriptors>
                                    <descriptor>${project.build.commonResourcesDirectory}/assembly/dist.xml</descriptor>
                                </descriptors>
                                <appendAssemblyId>false</appendAssemblyId>
                            </configuration>
                        </execution>
                        <execution>
                            <id>build-resources</id>
                            <goals>
                                <goal>single</goal>
                            </goals>
                            <phase>none</phase>
                            <inherited>false</inherited>
                            <configuration>
                                <descriptors>
                                    <descriptor>src/main/assembly/resources.xml</descriptor>
                                </descriptors>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                
                <plugin>
                    <groupId>org.asciidoctor</groupId>
                    <artifactId>asciidoctor-maven-plugin</artifactId>
                    <version>${asciidoctorj.maven.plugin.version}</version>
                    <configuration>
                        <sourceDirectory>src/main/asciidoc</sourceDirectory>
                        <sourceDocumentName>book.adoc</sourceDocumentName>
                        <!-- XXX - below depends on running jbake first -->
                        <backend>pdf</backend>
                        <outputFile>${doc.pdf}</outputFile>
                        <attributes>
                            <pdf-theme>${project.build.directory}/generated-docs/theme/jakartaee-theme.yml</pdf-theme>
                            <title-logo-image>image:img/jakarta_ee_logo_schooner_color_stacked_default.png[pdfwidth=4.25in,align=right]</title-logo-image>
                            <doctype>book</doctype>
                            <status>${status}</status>
                            <compat-mode/>
                            <data-uri/>
                            <icons>font</icons>
                            <pagenums/>
                            <toc/>
                            <icons>font</icons>
                            <sectanchors>true</sectanchors>
                            <idprefix/>
                            <idseparator>-</idseparator>
                            <docinfo1>true</docinfo1>
                            <embedAssets>true</embedAssets>
                        </attributes>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.asciidoctor</groupId>
                            <artifactId>asciidoctorj-pdf</artifactId>
                            <version>${asciidoctorj.pdf.version}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>generate-pdf-doc</id>
                            <goals>
                                <goal>process-asciidoc</goal>
                            </goals>
                            <phase>none</phase>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-scm-publish-plugin</artifactId>
                    <version>3.3.0</version>
                    <executions>
                        <execution>
                            <id>deploy-site</id>
                            <goals>
                                <goal>publish-scm</goal>
                            </goals>
                            <phase>deploy</phase>
                            <configuration>
                                <scmBranch>gh-pages</scmBranch>
                                <skipDeletedFiles>false</skipDeletedFiles>
                                <checkinComment>Update site</checkinComment>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>

            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-versions</id>
                        <phase>validate</phase>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>build-resources</id>
                        <phase>initialize</phase>
                        <inherited>false</inherited>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-resource</id>
                        <phase>generate-resources</phase>
                    </execution>
                </executions>
            </plugin>


        </plugins>
    </build>
</project>