https://github.com/xwiki/xwiki-commons
Raw File
Tip revision: a45d46962f8fca875b523fb0813777c2ad75e9e7 authored by Manuel Leduc on 17 April 2023, 08:43:34 UTC
[maven-release-plugin] prepare release xwiki-commons-15.3-rc-1
Tip revision: a45d469
pom.xml
<?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</artifactId>
    <version>15.3-rc-1</version>
  </parent>
  <artifactId>xwiki-commons-pom</artifactId>
  <name>XWiki Commons - Root POM</name>
  <packaging>pom</packaging>
  <properties>
    <!-- By default legacy dependencies are forbidden -->
    <xwiki.enforcer.no-legacy-dependencies.skip>${xwiki.enforcer.skip}</xwiki.enforcer.no-legacy-dependencies.skip>
    <!-- By default we perform checks on the POM content -->
    <xwiki.enforcer.valid-poms.skip>${xwiki.enforcer.skip}</xwiki.enforcer.valid-poms.skip>
    <!-- By default don't skip Spoon checks -->
    <xwiki.spoon.skip>false</xwiki.spoon.skip>
  </properties>
  <build>
    <defaultGoal>install</defaultGoal>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerArgs>
            <!-- TODO: At some point, we should turn on failing on warnings since they can be real errors and they keep
                 growing on our build logs and we need to start addressing them -->
            <!--arg>-Werror</arg-->
            <arg>-Xlint:all</arg>
            <!-- Disable the javac warning when compiling for an older JVM. Note that this can result in class files
                 that do not work on the older platform since references to non-existent methods can get included.
                 However, it's hard to specify a generic location of the JRE that will work on all devs machines which
                 is why we're ignoring the warning (since we want warnings to fail the build...).
                 For more details, see:
                 - https://blogs.oracle.com/darcy/entry/bootclasspath_older_source
                 - https://stackoverflow.com/questions/9164625/maven-use-jdk-7-to-compile-for-jvm-5
            -->
            <arg>-Xlint:-options</arg>
            <!-- Tell the compiler to preserve parameter names in the bytecode -->
            <arg>-parameters</arg>
          </compilerArgs>
          <showWarnings>true</showWarnings>
          <showDeprecation>true</showDeprecation>
          <!-- Tell the compiler to preserve parameter names in the bytecode -->
          <compilerArgument>-parameters</compilerArgument>
          <testCompilerArgument>-parameters</testCompilerArgument>
        </configuration>
      </plugin>
      <!-- We want to force packaging the license resources in the produced XWiki artifacts -->
      <plugin>
        <groupId>org.xwiki.commons</groupId>
        <artifactId>xwiki-commons-tool-remote-resource-plugin</artifactId>
        <version>15.3-rc-1</version>
        <dependencies>
          <dependency>
            <groupId>org.xwiki.commons</groupId>
            <artifactId>xwiki-commons-tool-license-resources</artifactId>
            <version>15.3-rc-1</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>xwiki-license-resources</id>
            <goals>
              <goal>process</goal>
            </goals>
            <configuration>
              <projectsData>LICENSES</projectsData>
              <resourceBundles>
                <resourceBundle>org.xwiki.commons:xwiki-commons-tool-license-resources:${commons.version}
                </resourceBundle>
              </resourceBundles>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.xwiki.commons</groupId>
            <artifactId>xwiki-commons-tool-enforcer-dependencies</artifactId>
            <version>15.3-rc-1</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>enforce-no-legacy-dependencies</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <skip>${xwiki.enforcer.no-legacy-dependencies.skip}</skip>
              <rules>
                <bannedDependencies>
                  <searchTransitive>true</searchTransitive>
                  <message>Don't depend on a XWiki Legacy modules!</message>
                  <excludes>
                    <exclude>.*xwiki.*:xwiki-commons-legacy-*</exclude>
                    <exclude>.*xwiki.*:xwiki-rendering-legacy-*</exclude>
                    <exclude>.*xwiki.*:xwiki-platform-legacy-*</exclude>
                  </excludes>
                </bannedDependencies>
              </rules>
            </configuration>
          </execution>
          <execution>
            <id>enforce-valid-poms</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <skip>${xwiki.enforcer.valid-poms.skip}</skip>
              <rules>
                <externalExtensionCheck />
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- Configure revapi to use a common configuration -->
      <plugin>
        <groupId>org.revapi</groupId>
        <artifactId>revapi-maven-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.xwiki.commons</groupId>
            <artifactId>xwiki-commons-tool-verification-resources</artifactId>
            <version>15.3-rc-1</version>
          </dependency>
        </dependencies>
        <configuration>
          <analysisConfigurationFiles>
            <configurationFile>
              <resource>revapi.json</resource>
            </configurationFile>
          </analysisConfigurationFiles>
        </configuration>
      </plugin>
      <!-- Execute Spoon plugin -->
      <plugin>
        <groupId>fr.inria.gforge.spoon</groupId>
        <artifactId>spoon-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>spoon-main</id>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <includeSource>true</includeSource>
              <includeTest>false</includeTest>
              <processors>
                <processor>org.xwiki.tool.spoon.ForbiddenInvocationProcessor</processor>
                <processor>org.xwiki.tool.spoon.ComponentAnnotationProcessor</processor>
                <processor>org.xwiki.tool.spoon.InjectAnnotationProcessor</processor>
              </processors>
              <processorProperties>
                <processorProperty>
                  <name>org.xwiki.tool.spoon.ForbiddenInvocationProcessor</name>
                  <properties>
                    <property>
                      <name>methods</name>
                      <!--
                        - File#deleteOnExit: Does not make any sense in the context of an application server and it can
                          cause memory leaks
                        - URL#equals: The URL#equals implementation is insane (it actually tries to access the host
                          with HTTP URLs for example)
                      -->
                      <value><![CDATA[
                        {
                          "java.io.File": ["deleteOnExit"],
                          "java.net.URL": ["equals"]
                        }
                      ]]></value>
                    </property>
                  </properties>
                </processorProperty>
                <processorProperty>
                  <name>org.xwiki.tool.spoon.ComponentAnnotationProcessor</name>
                  <properties>
                    <property>
                      <name>skipForeignDeclarations</name>
                      <value>false</value>
                    </property>
                  </properties>
                </processorProperty>
                <processorProperty>
                  <name>org.xwiki.tool.spoon.InjectAnnotationProcessor</name>
                  <properties>
                    <property>
                      <name>excludedFieldTypes</name>
                      <value><![CDATA[
                        []
                      ]]></value>
                    </property>
                  </properties>
                </processorProperty>
              </processorProperties>
            </configuration>
          </execution>
          <execution>
            <id>spoon-test</id>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <!-- TODO: Set to false when https://github.com/INRIA/spoon/issues/3582 is fixed -->
              <includeSource>true</includeSource>
              <includeTest>true</includeTest>
              <processors>
                <processor>org.xwiki.tool.spoon.JUnit5JUnit4Processor</processor>
              </processors>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <skip>${xwiki.spoon.skip}</skip>
          <!-- Don't fail in case of missing sources -->
          <skipSpoonErrors>true</skipSpoonErrors>
        </configuration>
        <dependencies>
          <!-- Contains custom Spoon processors -->
          <dependency>
            <groupId>org.xwiki.commons</groupId>
            <artifactId>xwiki-commons-tool-spoon-checks</artifactId>
            <version>15.3-rc-1</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <!-- Apply checkstyle rules and fail the build in case of errors. The checkstyle config
             files are taken from the xwiki-commons-tool-verification-resources JAR module.-->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <dependencies>
            <dependency>
              <groupId>org.xwiki.commons</groupId>
              <artifactId>xwiki-commons-tool-verification-resources</artifactId>
              <version>15.3-rc-1</version>
            </dependency>
          </dependencies>
          <configuration>
            <propertyExpansion>
              currentVersion=${project.version}
            </propertyExpansion>
            <failOnViolation>true</failOnViolation>
            <!-- Used by the "blocker" execution id and the "default-cli" one
                (i.e. when executing "mvn checkstyle:check") -->
            <configLocation>checkstyle-blocker.xml</configLocation>
          </configuration>
          <executions>
            <execution>
              <id>default</id>
              <goals>
                <goal>check</goal>
              </goals>
              <configuration>
                <configLocation>checkstyle.xml</configLocation>
              </configuration>
            </execution>
            <execution>
              <!-- Checks that should never be excluded from executing in maven projects -->
              <id>blocker</id>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <!-- Check license headers and fail the build if they're missing or not matching the defined format -->
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <configuration>
            <skip>${xwiki.license.skip}</skip>
            <licenseSets>
              <licenseSet>
                <header>license.txt</header>
                <!-- We're only interested in checking our sources and our POMs -->
                <includes>
                  <!-- At the moment, only check the following list of files for license headers -->
                  <include>pom.xml</include>
                  <include>src/**/*.java</include>
                  <include>src/**/*.aj</include>
                  <include>src/**/*.bat</include>
                  <include>src/**/*.sh</include>
                  <include>src/**/ApplicationResources.properties</include>
                  <include>src/**/*.vm</include>
                  <include>src/**/*.js</include>
                  <include>src/**/*.vue</include>
                </includes>
                <excludes>
                  <!-- At the moment we don't have a comment syntax for components.txt files so we need to exclude them
                       from the check -->
                  <exclude>**/components.txt</exclude>
                  <exclude>**/component-overrides.txt</exclude>
                  <!-- Since there's no comment syntax for Maven IT tests's goal.txt file we need to exclude it -->
                  <exclude>**/it/**/goals.txt</exclude>
                  <exclude>**/goal.txt</exclude>
                </excludes>
              </licenseSet>
            </licenseSets>
            <headerDefinitions>
              <!-- Our styles for headers aren't standard so we need to define them in a custom manner.
                   See xwiki-commons-tool-verification-resources module -->
              <headerDefinition>license-xml-definition.xml</headerDefinition>
              <headerDefinition>license-script-definition.xml</headerDefinition>
              <headerDefinition>license-batch-definition.xml</headerDefinition>
              <headerDefinition>license-vm-definition.xml</headerDefinition>
            </headerDefinitions>
            <!-- Our Java, XML and VM styles aren't the default so we need to change the mapping -->
            <mapping>
              <java>SLASHSTAR_STYLE</java>
              <aj>SLASHSTAR_STYLE</aj>
              <vm>SHARPSHARP_STYLE</vm>
              <vue>XML_STYLE</vue>
            </mapping>
          </configuration>
          <!-- Add a dependency since this is where the license-maven-plugin plugin will find the license.txt file -->
          <dependencies>
            <dependency>
              <groupId>org.xwiki.commons</groupId>
              <artifactId>xwiki-commons-tool-verification-resources</artifactId>
              <version>15.3-rc-1</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.xwiki.commons</groupId>
          <artifactId>xwiki-commons-tool-xar-plugin</artifactId>
          <version>15.3-rc-1</version>
          <configuration>
            <!-- Add missing license headers by default -->
            <formatLicense>true</formatLicense>
            <titles>
              <!-- Verify that all WebPreferences pages have the same title for consistency -->
              <property>
                <name>.*WebPreferences</name>
                <value>\$services\.localization\.render\('admin.preferences.title'\)</value>
              </property>
            </titles>
            <!-- Check for empty parents since, even though this is deprecated, we still want to set it FTM -->
            <emptyParentSkip>false</emptyParentSkip>
          </configuration>
        </plugin>
        <!-- Add archiving support for various XWiki specific formats in the dependency plugin -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <dependencies>
            <dependency>
              <groupId>org.xwiki.commons</groupId>
              <artifactId>xwiki-commons-tool-archiver</artifactId>
              <version>15.3-rc-1</version>
            </dependency>
          </dependencies>
        </plugin>
        <!-- Add archiving support for various XWiki specific formats in the assembly plugin -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <dependencies>
            <dependency>
              <groupId>org.xwiki.commons</groupId>
              <artifactId>xwiki-commons-tool-archiver</artifactId>
              <version>15.3-rc-1</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>
back to top