<?xml version="1.0" encoding="UTF-8"?>
<!--
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.xwiki.commons</groupId>
    <artifactId>xwiki-commons-pom</artifactId>
    <version>18.8.0</version>
    <!-- Note: Do not modify the <relativePath> tag here as this can cause issues. See the pom.xml for xwiki-platform
         for more details. By using an empty value we force Maven to resolve the parent from the Maven repositories,
         see http://maven.apache.org/ref/3.2.3/maven-model/maven.html#class_parent -->
    <relativePath />
  </parent>
  <groupId>org.xwiki.rendering</groupId>
  <artifactId>xwiki-rendering</artifactId>
  <version>18.8.0</version>
  <name>XWiki Rendering - Parent POM</name>
  <packaging>pom</packaging>
  <description>XWiki Rendering - Parent POM</description>
  <scm>
    <url>https://github.com/${xwiki.github.owner}/${xwiki.github.repository}/tree/master/</url>
    <tag>xwiki-rendering-18.8.0</tag>
  </scm>
  <issueManagement>
    <system>jira</system>
    <url>https://jira.xwiki.org/browse/XRENDERING</url>
  </issueManagement>
  <modules>
    <!-- Sorted Alphabetically -->
    <module>xwiki-rendering-api</module>
    <module>xwiki-rendering-archetype-macro</module>
    <module>xwiki-rendering-integration-tests</module>
    <module>xwiki-rendering-macros</module>
    <module>xwiki-rendering-syntaxes</module>
    <module>xwiki-rendering-test</module>
    <module>xwiki-rendering-transformations</module>
    <module>xwiki-rendering-wikimodel</module>
    <module>xwiki-rendering-xml</module>
  </modules>
  <properties>
    <!-- Useful for Rendering extensions -->
    <rendering.version>${commons.version}</rendering.version>
    <!-- By default check that unit tests don't output anything to the console -->
    <xwiki.surefire.captureconsole.skip>false</xwiki.surefire.captureconsole.skip>

    <!-- The recommended version of known extensions to use -->
    <xwiki.extension.recommendedVersions.rendering>
      ${xwiki.extension.recommendedVersions.commons},
      org.xwiki.rendering:.*/[${rendering.version}]
    </xwiki.extension.recommendedVersions.rendering>
    <xwiki.extension.recommendedVersions>${xwiki.extension.recommendedVersions.rendering}</xwiki.extension.recommendedVersions>

    <!-- GitHub related metadata -->
    <xwiki.github.repository>xwiki-rendering</xwiki.github.repository>

    <!-- Enable reproducible builds -->
    <project.build.outputTimestamp>2026-09-29T11:48:52Z</project.build.outputTimestamp>
  </properties>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <configuration>
            <archive>
              <!-- Use the manifest file generated by the OSGi Maven Bundle Plugin -->
              <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
            </archive>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <!-- Generate OSGi Manifest information to all JARs -->
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <includes>
            <include>**/*Test.java</include>
            <include>**/*IntegrationTests.java</include>
          </includes>
          <!-- Verify that unit tests don't output anything to stdout/stderr -->
          <systemPropertyVariables>
            <!-- This property makes it simple for some module to exclude the check (for example for functional
                 tests) -->
            <xwiki.surefire.captureconsole.skip>${xwiki.surefire.captureconsole.skip}</xwiki.surefire.captureconsole.skip>
          </systemPropertyVariables>
        </configuration>
        <dependencies>
          <!-- Used to automatically register our custom JUnit5 Extensions using the service loader mechanism.
               We also need to have the JAR containing our extensions visible to JUnit5's ClassLoader. This is
               done here and not in the top level commons pom.xml, as otherwise it would cause a cyclic dependency.
          -->
          <dependency>
            <groupId>org.xwiki.commons</groupId>
            <artifactId>xwiki-commons-tool-test-simple</artifactId>
            <version>${commons.version}</version>
          </dependency>
        </dependencies>
      </plugin>
      <!-- Apply the Checkstyle configurations defined in the top level pom.xml file -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
      <!-- Check license headers -->
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <configuration>
          <licenseSets>
            <licenseSet>
              <excludes>
                <!-- Unfortunately we need to copy some excludes from the top level POM since Maven or the License
                     plugin don't merge excludes apparently... -->
                <exclude>**/components.txt</exclude>
                <exclude>**/goal.txt</exclude>
                <exclude>**/it/**/goals.txt</exclude>
                <!-- Exclude Rendering Test Data files -->
                <exclude>**/*.test</exclude>
                <exclude>**/*.in.*txt</exclude>
                <exclude>**/*.out.txt</exclude>
                <exclude>**/*.inout.txt</exclude>
                <exclude>**/*.in.*xml</exclude>
                <exclude>**/*.out.xml</exclude>
                <exclude>**/*.inout.xml</exclude>
                <!-- Exclude Rendering Test framework test data file -->
                <exclude>**/ctstest/type/test/test1.inout.xml</exclude>
                <!-- l10n doesn't put the license header on the generated translation files. -->
                <exclude>**/ApplicationResources_*.properties</exclude>
              </excludes>
            </licenseSet>
          </licenseSets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-platform-isolation</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <bannedDependencies>
                  <excludes>
                    <!-- Ensure that the XWiki Rendering top level module is independent of the XWiki Platform (so that
                         it can be used standalone) -->
                    <exclude>org.xwiki.platform:*</exclude>
                  </excludes>
                </bannedDependencies>
              </rules>
            </configuration>
          </execution>
          <!-- Verify that all org.xwiki.commons dependencies in Commons have a version specified either as:
               - ${commons.version}
               - a value not starting with $ (we want to allow supporting ranges)
               Also verifies that all org.xwiki.rendering dependencies in Commons have a version specified either as:
               - ${project.version}
               - a value not starting with $ (we want to allow supporting ranges)
          -->
          <execution>
            <id>check-dependency-version</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <validateDependencyVersion>
                  <versionCheck>
                    <groupIdPrefix>org.xwiki.commons</groupIdPrefix>
                    <allowedVersionRegex>\$\{commons.version\}</allowedVersionRegex>
                  </versionCheck>
                  <versionCheck>
                    <groupIdPrefix>org.xwiki.rendering</groupIdPrefix>
                    <allowedVersionRegex>\$\{project.version\}|${rendering.version}</allowedVersionRegex>
                  </versionCheck>
                </validateDependencyVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.revapi</groupId>
        <artifactId>revapi-maven-plugin</artifactId>
        <configuration>
          <analysisConfiguration>
            <revapi.filter>
              <archives>
                <!-- We're ignoring all API incompatibilities from XWiki dependencies (i.e. commons)
                     since they're already covered by their own builds and we release all of them together. -->
                <exclude>
                  <item>org\.xwiki\.commons:.*:.*</item>
                </exclude>
              </archives>
            </revapi.filter>
            <!-- Add ignores here using the following syntax. You can use a single <revapi.differences> entry but it
                 cannot be empty. You can also use different <revapi.differences> entries if you wish to use a common
                 justification for example (see example below).

                 By default criticality is set to "error" if not specified.
                 See https://revapi.org/revapi/configuration.html#_criticality for more.

                 Note: you can use regexes by using the syntax: <regex>true</regex>
                 Don't forget to '\'-escape dots and other special characters in this case ;)

                 Common justification example:

                 <revapi.differences>
                   <justification>This change is necessary to fix bug #1234</justification>
                   <criticality>highlight</criticality>
                   <differences>
                     <item>
                       <code>java.method.addToInterface</code>
                       <fullQualifiedClassName>com.acme.ToolInterface</fullyQualifiedClassName>
                       <new>method void com.acme.ToolInterface::setup()</new>
                     </item>
                     <item>
                       <code>java.method.removed</code>
                       <fullQualifiedClassName>com.acme.ToolInterface</fullyQualifiedClassName>
                       <old>method void com.acme.ToolInterface::initialize()</old>
                       <justification>...</justification>
                     </item>
                   </differences>
                 </revapi.differences>

                 Single justification example:

                 <revapi.differences>
                   <differences>
                     <item>
                       <code>java.method.removed</code>
                       <old>method void org.xwiki.diff.xml.XMLDiff::xxx()</old>
                       <justification>Unstable API added by mistake.</justification>
                       <criticality>highlight</criticality>
                     </item>
                   </differences>
                 </revapi.differences>
            -->
            <revapi.differences>
              <differences>
                <item>
                  <ignore>true</ignore>
                  <code>java.class.removed</code>
                  <old>interface org.xwiki.rendering.wikimodel.IWikiSerializer</old>
                  <criticality>highlight</criticality>
                  <justification>Unused WikiModel serializer API. XWiki serializes through the Renderer/Listener
                    implementations in xwiki-rendering-syntaxes, never through WikiModel's serializers. This interface
                    was imported with WikiModel in XRENDERING-173 and has never had an implementor nor a
                    caller.</justification>
                </item>
                <item>
                  <ignore>true</ignore>
                  <code>java.class.removed</code>
                  <old>class org.xwiki.rendering.wikimodel.jspwiki.JspWikiSerializer</old>
                  <criticality>highlight</criticality>
                  <justification>Unused WikiModel serializer, never completed (its javadoc says "Not ready yet.") and
                    never called. JSPWiki rendering is handled by xwiki-rendering-syntax-jspwiki.</justification>
                </item>
                <item>
                  <ignore>true</ignore>
                  <code>java.class.removed</code>
                  <old>class org.xwiki.rendering.wikimodel.xwiki.xwiki10.XWikiSerializer</old>
                  <criticality>highlight</criticality>
                  <justification>Unused WikiModel serializer for XWiki 1.0 syntax, imported with WikiModel in
                    XRENDERING-173 and never called. XWiki syntax rendering is handled by the renderers in
                    xwiki-rendering-syntaxes.</justification>
                </item>
                <item>
                  <ignore>true</ignore>
                  <code>java.class.removed</code>
                  <old>class org.xwiki.rendering.wikimodel.xwiki.xwiki20.XWikiSerializer2</old>
                  <criticality>highlight</criticality>
                  <justification>Unused WikiModel serializer for XWiki 2.0 syntax, imported with WikiModel in
                    XRENDERING-173 and never called. XWiki syntax rendering is handled by the renderers in
                    xwiki-rendering-syntaxes.</justification>
                </item>
                <item>
                  <ignore>true</ignore>
                  <code>java.method.parameterTypeChanged</code>
                  <old>parameter boolean org.xwiki.rendering.wikimodel.WikiPageUtil::isValidXmlNameChar(===char===, boolean)</old>
                  <new>parameter boolean org.xwiki.rendering.wikimodel.WikiPageUtil::isValidXmlNameChar(===int===, boolean)</new>
                  <parameterIndex>0</parameterIndex>
                  <criticality>allowed</criticality>
                  <justification>Replaced by isValidXmlNameChar(int, boolean), which takes a code point and can
                    therefore express the whole XML NameChar production, including the supplementary range
                    #x10000-#xEFFFF that a char cannot hold. The char signature is re-added by the
                    xwiki-rendering-legacy-wikimodel module.</justification>
                </item>
                <item>
                  <ignore>true</ignore>
                  <code>java.method.parameterTypeChanged</code>
                  <old>parameter boolean org.xwiki.rendering.wikimodel.WikiPageUtil::isValidXmlNameStartChar(===char===, boolean)</old>
                  <new>parameter boolean org.xwiki.rendering.wikimodel.WikiPageUtil::isValidXmlNameStartChar(===int===, boolean)</new>
                  <parameterIndex>0</parameterIndex>
                  <criticality>allowed</criticality>
                  <justification>Replaced by isValidXmlNameStartChar(int, boolean), which takes a code point and can
                    therefore express the whole XML NameStartChar production, including the supplementary range
                    #x10000-#xEFFFF that a char cannot hold. The char signature is re-added by the
                    xwiki-rendering-legacy-wikimodel module.</justification>
                </item>
                <item>
                  <ignore>true</ignore>
                  <code>java.class.nonFinalClassInheritsFromNewClass</code>
                  <new>class org.xwiki.rendering.wikimodel.PrintTextListener</new>
                  <criticality>allowed</criticality>
                  <justification>
                    PrintTextListener extends EmptyWemListener instead of implementing IWemListener directly, so that
                    the no-op listener callbacks it used to redeclare are inherited instead of being copied.
                    EmptyWemListener supplies exactly the empty bodies that were declared before, and the only members
                    it adds to these types are the no-arg beginDocument() and endDocument() no-ops. No existing method
                    is removed or changed.
                  </justification>
                </item>
                <item>
                  <ignore>true</ignore>
                  <code>java.class.nonFinalClassInheritsFromNewClass</code>
                  <new>class org.xwiki.rendering.wikimodel.EventDumpListener</new>
                  <criticality>allowed</criticality>
                  <justification>
                    This class is not modified itself; it is a subclass of PrintTextListener, which now extends
                    EmptyWemListener instead of implementing IWemListener directly, so EmptyWemListener appears in this
                    class's inherited hierarchy too. EmptyWemListener supplies exactly the empty listener callbacks that
                    PrintTextListener declared before, and the only members it adds to these types are the no-arg
                    beginDocument() and endDocument() no-ops. No existing method is removed or changed.
                  </justification>
                </item>
                <item>
                  <ignore>true</ignore>
                  <code>java.class.nonFinalClassInheritsFromNewClass</code>
                  <new>class org.xwiki.rendering.wikimodel.xhtml.PrintInlineListener</new>
                  <criticality>allowed</criticality>
                  <justification>
                    This class is not modified itself; it is a subclass of PrintTextListener, which now extends
                    EmptyWemListener instead of implementing IWemListener directly, so EmptyWemListener appears in this
                    class's inherited hierarchy too. EmptyWemListener supplies exactly the empty listener callbacks that
                    PrintTextListener declared before, and the only members it adds to these types are the no-arg
                    beginDocument() and endDocument() no-ops. No existing method is removed or changed.
                  </justification>
                </item>
                <item>
                  <ignore>true</ignore>
                  <code>java.class.nonFinalClassInheritsFromNewClass</code>
                  <new>class org.xwiki.rendering.wikimodel.xhtml.PrintListener</new>
                  <criticality>allowed</criticality>
                  <justification>
                    This class is not modified itself; it is a subclass of PrintTextListener, which now extends
                    EmptyWemListener instead of implementing IWemListener directly, so EmptyWemListener appears in this
                    class's inherited hierarchy too. EmptyWemListener supplies exactly the empty listener callbacks that
                    PrintTextListener declared before, and the only members it adds to these types are the no-arg
                    beginDocument() and endDocument() no-ops. No existing method is removed or changed.
                  </justification>
                </item>
              </differences>
            </revapi.differences>
          </analysisConfiguration>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <!-- Profile to build the Standalone module -->
    <profile>
      <id>standalone</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <modules>
        <module>xwiki-rendering-standalone</module>
      </modules>
    </profile>
    <!-- Profile to build Legacy modules -->
    <profile>
      <id>legacy</id>
      <modules>
        <module>xwiki-rendering-legacy</module>
      </modules>
    </profile>
    <profile>
      <id>clover</id>
      <properties>
        <!-- Don't check that unit tests don't output anything to the console since for example Clover will output
             messages such as "Updating existing database at '...'." during tests! -->
        <xwiki.surefire.captureconsole.skip>true</xwiki.surefire.captureconsole.skip>
      </properties>
    </profile>
    <profile>
      <!-- To be executed when building snapshots. This allows to not have to have a special settings.xml file
           when building snapshots while not incurring the downside of specifying a maven remote repo for releases,
           see https://blog.sonatype.com/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/ -->
      <id>snapshot</id>
      <pluginRepositories>
        <pluginRepository>
          <id>xwiki-snapshots</id>
          <name>XWiki Nexus Plugin Snapshot Repository</name>
          <url>https://nexus-snapshots.xwiki.org/repository/snapshots</url>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </pluginRepository>
        <pluginRepository>
          <id>xwiki-releases</id>
          <name>XWiki Nexus Plugin Releases Repository Proxy</name>
          <url>https://nexus.xwiki.org/nexus/content/groups/public</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
      <repositories>
        <repository>
          <id>xwiki-snapshots</id>
          <name>XWiki Nexus Snapshot Repository</name>
          <url>https://nexus-snapshots.xwiki.org/repository/snapshots</url>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
        <repository>
          <id>xwiki-releases</id>
          <name>XWiki Nexus Releases Repository Proxy</name>
          <url>https://nexus.xwiki.org/nexus/content/groups/public</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
      </repositories>
    </profile>
  </profiles>
</project>
