You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2022/12/21 21:07:58 UTC

[logging-log4j-tools] branch master updated (61213ca -> 1e9e66f)

This is an automated email from the ASF dual-hosted git repository.

vy pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j-tools.git


    from 61213ca  Bump actions/checkout from 3.1.0 to 3.2.0 (#9)
     new 6ae16ae  Hardening project infrastructure with more Maven plugins
     new 9545660  Rename `dependabot.yml` to `dependabot.yaml`
     new 6cced03  Improve Spotless integration
     new 8f975f0  Add more meta information to `/pom.xml`
     new 1e9e66f  Create `log4j-tools-bom` and `log4j-tools-parent` POMs

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .editorconfig                                      |  66 ++++++
 .github/{dependabot.yml => dependabot.yaml}        |   0
 CHANGELOG.adoc => SECURITY.adoc                    |   5 +-
 log4j-changelog/pom.xml                            |  11 +-
 .../org/apache/logging/log4j/tools/XmlReader.java  |   8 +-
 .../org/apache/logging/log4j/tools/XmlWriter.java  |   8 +-
 .../log4j/tools/changelog/ChangelogEntry.java      |   1 +
 .../log4j/tools/changelog/ChangelogRelease.java    |   1 +
 .../tools/changelog/exporter/AsciiDocExporter.java |  20 +-
 .../tools/changelog/importer/MavenChanges.java     |   1 +
 .../changelog/importer/MavenChangesImporter.java   |   8 +-
 .../changelog/releaser/ChangelogReleaser.java      |  13 +-
 log4j-tools-parent/pom.xml                         | 253 +++++++++++++++++++++
 pom.xml                                            | 184 +++++++++++----
 ...StringUtils.java => spotless-license-header.txt |  15 --
 15 files changed, 509 insertions(+), 85 deletions(-)
 create mode 100644 .editorconfig
 rename .github/{dependabot.yml => dependabot.yaml} (100%)
 copy CHANGELOG.adoc => SECURITY.adoc (69%)
 create mode 100644 log4j-tools-parent/pom.xml
 copy log4j-changelog/src/main/java/org/apache/logging/log4j/tools/StringUtils.java => spotless-license-header.txt (69%)


[logging-log4j-tools] 04/05: Add more meta information to `/pom.xml`

Posted by vy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j-tools.git

commit 8f975f0e31ac3884a06c60b54610b7992e5b3579
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Tue Dec 20 21:06:12 2022 +0100

    Add more meta information to `/pom.xml`
---
 pom.xml | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 70 insertions(+), 12 deletions(-)

diff --git a/pom.xml b/pom.xml
index 18af42f..4735c81 100644
--- a/pom.xml
+++ b/pom.xml
@@ -36,18 +36,6 @@
     <module>log4j-changelog</module>
   </modules>
 
-  <scm>
-    <url>https://github.com/apache/logging-log4j-tools</url>
-    <connection>scm:git:git@github.com:apache/logging-log4j-tools.git</connection>
-    <developerConnection>scm:git:git@github.com:apache/logging-log4j-tools.git</developerConnection>
-    <tag>HEAD</tag>
-  </scm>
-
-  <distributionManagement>
-    <!-- `repository` from parent `org.apache.logging:logging-parent` (id: `apache.releases.https`) -->
-    <!-- `snapshotRepository` from parent `org.apache.logging:logging-parent` (id: `apache.snapshots.https`) -->
-  </distributionManagement>
-
   <properties>
 
     <!-- common properties -->
@@ -265,4 +253,74 @@
 
   </build>
 
+  <distributionManagement>
+    <!-- `repository` from parent `org.apache.logging:logging-parent` (id: `apache.releases.https`) -->
+    <!-- `snapshotRepository` from parent `org.apache.logging:logging-parent` (id: `apache.snapshots.https`) -->
+  </distributionManagement>
+
+  <scm>
+    <url>https://github.com/apache/logging-log4j-tools</url>
+    <connection>scm:git:git@github.com:apache/logging-log4j-tools.git</connection>
+    <developerConnection>scm:git:git@github.com:apache/logging-log4j-tools.git</developerConnection>
+    <tag>HEAD</tag>
+  </scm>
+
+  <url>https://github.com/apache/logging-log4j-tools</url>
+
+  <issueManagement>
+    <system>GitHub Issues</system>
+    <url>https://github.com/apache/logging-log4j-tools/issues</url>
+  </issueManagement>
+
+  <licenses>
+    <license>
+      <name>Apache License, Version 2.0</name>
+      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
+      <distribution>repo</distribution>
+      <comments>A business-friendly OSS license</comments>
+    </license>
+  </licenses>
+
+  <organization>
+    <name>Apache Software Foundation</name>
+    <url>https://apache.org</url>
+  </organization>
+
+  <inceptionYear>2022</inceptionYear>
+
+  <developers>
+
+    <developer>
+      <id>rgoers</id>
+      <name>Ralph Goers</name>
+      <email>rgoers@apache.org</email>
+      <organization>Nextiva</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>America/Phoenix</timezone>
+    </developer>
+
+    <developer>
+      <id>vy</id>
+      <name>Volkan Yazıcı</name>
+      <email>vy@apache.org</email>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>Europe/Amsterdam</timezone>
+    </developer>
+
+    <developer>
+      <id>pkarwasz</id>
+      <name>Piotr P. Karwasz</name>
+      <email>pkarwasz@apache.org</email>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>Europe/Warsaw</timezone>
+    </developer>
+
+  </developers>
+
 </project>


[logging-log4j-tools] 03/05: Improve Spotless integration

Posted by vy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j-tools.git

commit 6cced03179a9c56a789107f2c0f8c32a69f1a8de
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Mon Dec 19 22:02:14 2022 +0100

    Improve Spotless integration
---
 pom.xml                     | 101 ++++++++++++++++++++++++--------------------
 spotless-license-header.txt |  16 +++++++
 2 files changed, 71 insertions(+), 46 deletions(-)

diff --git a/pom.xml b/pom.xml
index 0b18eff..18af42f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -206,54 +206,63 @@
         </executions>
       </plugin>
 
-  <!-- Configuration here must match the one in `.editorconfig`! -->
-  <plugin>
-    <groupId>com.diffplug.spotless</groupId>
-    <artifactId>spotless-maven-plugin</artifactId>
-    <executions>
-      <execution>
-        <id>default-spotless</id>
-        <phase>verify</phase>
-        <goals>
-          <goal>check</goal>
-        </goals>
-      </execution>
-    </executions>
-    <configuration>
-      <ratchetFrom>HEAD~31</ratchetFrom>
-      <java>
-        <importOrder>
-          <order>java,javax,org.apache.logging,,\#java,\#javax,\#org.apache.logging,\#</order>
-        </importOrder>
-      </java>
-    </configuration>
-  </plugin>
+      <!-- Configuration here must match the one in `.editorconfig`! -->
+      <plugin>
+        <groupId>com.diffplug.spotless</groupId>
+        <artifactId>spotless-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>default-spotless</id>
+            <phase>verify</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <java>
+            <licenseHeader>
+              <file>${maven.multiModuleProjectDirectory}/spotless-license-header.txt</file>
+            </licenseHeader>
+            <trimTrailingWhitespace/>
+            <endWithNewline/>
+            <removeUnusedImports/>
+            <indent>
+              <spaces>true</spaces>
+              <spacesPerTab>4</spacesPerTab>
+            </indent>
+            <importOrder>
+              <order>java,javax,org.apache.logging,,\#java,\#javax,\#org.apache.logging,\#</order>
+            </importOrder>
+          </java>
+        </configuration>
+      </plugin>
 
-  <plugin>
-    <groupId>com.github.spotbugs</groupId>
-    <artifactId>spotbugs-maven-plugin</artifactId>
-    <executions>
-      <execution>
-        <id>default-spotbugs</id>
-        <phase>verify</phase>
-        <goals>
-          <goal>check</goal>
-        </goals>
-      </execution>
-    </executions>
-    <configuration>
-      <plugins>
-        <plugin>
-          <groupId>com.h3xstream.findsecbugs</groupId>
-          <artifactId>findsecbugs-plugin</artifactId>
-          <version>${findsecbugs-plugin.version}</version>
-        </plugin>
-      </plugins>
-    </configuration>
-  </plugin>
+      <plugin>
+        <groupId>com.github.spotbugs</groupId>
+        <artifactId>spotbugs-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>default-spotbugs</id>
+            <phase>verify</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <plugins>
+            <plugin>
+              <groupId>com.h3xstream.findsecbugs</groupId>
+              <artifactId>findsecbugs-plugin</artifactId>
+              <version>${findsecbugs-plugin.version}</version>
+            </plugin>
+          </plugins>
+        </configuration>
+      </plugin>
 
-</plugins>
+    </plugins>
 
-</build>
+  </build>
 
 </project>
diff --git a/spotless-license-header.txt b/spotless-license-header.txt
new file mode 100644
index 0000000..4f33236
--- /dev/null
+++ b/spotless-license-header.txt
@@ -0,0 +1,16 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */


[logging-log4j-tools] 02/05: Rename `dependabot.yml` to `dependabot.yaml`

Posted by vy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j-tools.git

commit 9545660aafe78adb688ba70a6d244d555f352156
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Mon Dec 19 20:58:14 2022 +0100

    Rename `dependabot.yml` to `dependabot.yaml`
---
 .github/{dependabot.yml => dependabot.yaml} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/.github/dependabot.yml b/.github/dependabot.yaml
similarity index 100%
rename from .github/dependabot.yml
rename to .github/dependabot.yaml


[logging-log4j-tools] 01/05: Hardening project infrastructure with more Maven plugins

Posted by vy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j-tools.git

commit 6ae16aea4e10b7f484c50952f1cb07c7af16e4de
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Mon Dec 19 13:33:13 2022 +0100

    Hardening project infrastructure with more Maven plugins
---
 .editorconfig                                      |  66 ++++++++++
 SECURITY.adoc                                      |  21 ++++
 log4j-changelog/pom.xml                            |   8 ++
 .../org/apache/logging/log4j/tools/XmlReader.java  |   8 +-
 .../org/apache/logging/log4j/tools/XmlWriter.java  |   8 +-
 .../log4j/tools/changelog/ChangelogEntry.java      |   1 +
 .../log4j/tools/changelog/ChangelogRelease.java    |   1 +
 .../tools/changelog/exporter/AsciiDocExporter.java |  20 ++--
 .../tools/changelog/importer/MavenChanges.java     |   1 +
 .../changelog/importer/MavenChangesImporter.java   |   8 +-
 .../changelog/releaser/ChangelogReleaser.java      |  13 +-
 pom.xml                                            | 133 ++++++++++++++++++++-
 12 files changed, 267 insertions(+), 21 deletions(-)

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..4274445
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,66 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+#      https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Configuration here must match the one for Spotless in `pom.xml`!
+
+root = true
+
+[*]
+indent_size = 4
+ij_continuation_indent_size = 8
+indent_style = space
+trim_trailing_whitespace = true
+
+# `ij_any_use_relative_indents = true` is deliberately left out since it messes up the indentation in ternary operator usages
+
+# Split some things over multiple lines to keep lines short
+ij_any_call_parameters_wrap = on_every_item
+ij_any_method_parameters_wrap = on_every_item
+ij_any_method_call_chain_wrap = on_every_item
+
+# Don't align with the first line to avoid single-line changes having an impact in the rest of the code
+ij_any_align_multiline_parameters_in_calls = false
+ij_any_align_multiline_parameters = false
+ij_any_align_multiline_chained_methods = false
+
+# Only use `import *` when importing 5 or more
+ij_java_names_count_to_use_import_on_demand = 5
+ij_java_class_count_to_use_import_on_demand = 5
+
+# Order imports
+# `*` denotes any packages except explicitly specified ones
+# `|` denotes a blank line
+# `$` denotes the prefix for static packages
+# `**` means including subpackages
+ij_java_imports_layout = java.**, |, javax.**, |, org.apache.logging.**, |, *, |, $java.**, |, $javax.**, |, $org.apache.logging.**, |, $*
+
+# Force curly braces
+ij_any_for_brace_force = always
+ij_any_if_brace_force = always
+ij_any_do_while_brace_force = always
+ij_any_while_brace_force = always
+
+# Don't align parameters and exceptions in javadoc based on the longest names to avoid single-line changes having an impact in the rest of the code
+ij_java_doc_align_param_comments = false
+ij_java_doc_align_exception_comments = false
+
+[*.{xml,properties,yml,yaml,json}]
+indent_size = 2
+
+[*.{md,adoc}]
+indent_size = 2
+ij_any_wrap_long_lines = false
+# The `no` value doesn't work in IntelliJ IDEA so a big number does the trick as well in most cases:
+max_line_length = 9999
diff --git a/SECURITY.adoc b/SECURITY.adoc
new file mode 100644
index 0000000..cbbb429
--- /dev/null
+++ b/SECURITY.adoc
@@ -0,0 +1,21 @@
+////
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+    https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+////
+
+= Security Policy
+
+If you have encountered an unlisted security vulnerability or other unexpected behaviour that has security impact, please report them privately to mailto:security@logging.apache.org[the Log4j security mailing list].
+See https://logging.apache.org/log4j/2.x/security.html[the Log4j Security page] for further details.
diff --git a/log4j-changelog/pom.xml b/log4j-changelog/pom.xml
index 6b01ea7..a826146 100644
--- a/log4j-changelog/pom.xml
+++ b/log4j-changelog/pom.xml
@@ -29,4 +29,12 @@
 
   <artifactId>log4j-changelog</artifactId>
 
+  <dependencies>
+    <dependency>
+      <groupId>com.github.spotbugs</groupId>
+      <artifactId>spotbugs-annotations</artifactId>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+
 </project>
diff --git a/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/XmlReader.java b/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/XmlReader.java
index f2d8465..6e203a2 100644
--- a/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/XmlReader.java
+++ b/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/XmlReader.java
@@ -23,8 +23,13 @@ import java.util.List;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
 import java.util.stream.Stream;
-import javax.xml.parsers.*;
 
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -55,6 +60,7 @@ public final class XmlReader {
         }
     }
 
+    @SuppressFBWarnings("XXE_SAXPARSER")
     private static Document readXml(final InputStream inputStream) throws Exception {
         final SAXParserFactory parserFactory = SAXParserFactory.newInstance();
         final SAXParser parser = parserFactory.newSAXParser();
diff --git a/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/XmlWriter.java b/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/XmlWriter.java
index 1665ac3..78a0f59 100644
--- a/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/XmlWriter.java
+++ b/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/XmlWriter.java
@@ -23,6 +23,7 @@ import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.StandardOpenOption;
 import java.util.function.Consumer;
+
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.transform.OutputKeys;
@@ -31,6 +32,7 @@ import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import org.w3c.dom.Comment;
 import org.w3c.dom.Document;
 
@@ -44,7 +46,10 @@ public final class XmlWriter {
         try {
             final String xml = toString(documentConsumer);
             final byte[] xmlBytes = xml.getBytes(ENCODING);
-            Files.createDirectories(filepath.getParent());
+            Path filepathParent = filepath.getParent();
+            if (filepathParent != null) {
+                Files.createDirectories(filepathParent);
+            }
             Files.write(filepath, xmlBytes, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);
         } catch (final Exception error) {
             final String message = String.format("failed writing XML to file `%s`", filepath);
@@ -91,6 +96,7 @@ public final class XmlWriter {
         }
     }
 
+    @SuppressFBWarnings({"XXE_DTD_TRANSFORM_FACTORY", "XXE_XSLT_TRANSFORM_FACTORY"})
     private static String serializeXmlDocument(final Document document) throws Exception {
         final Transformer transformer = TransformerFactory.newInstance().newTransformer();
         final StreamResult result = new StreamResult(new StringWriter());
diff --git a/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/ChangelogEntry.java b/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/ChangelogEntry.java
index cf46cdd..fb5b130 100644
--- a/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/ChangelogEntry.java
+++ b/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/ChangelogEntry.java
@@ -23,6 +23,7 @@ import java.util.stream.Collectors;
 
 import org.apache.logging.log4j.tools.XmlReader;
 import org.apache.logging.log4j.tools.XmlWriter;
+
 import org.w3c.dom.Element;
 
 import static org.apache.logging.log4j.tools.StringUtils.trimNullable;
diff --git a/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/ChangelogRelease.java b/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/ChangelogRelease.java
index beb5508..cb74175 100644
--- a/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/ChangelogRelease.java
+++ b/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/ChangelogRelease.java
@@ -20,6 +20,7 @@ import java.nio.file.Path;
 
 import org.apache.logging.log4j.tools.XmlReader;
 import org.apache.logging.log4j.tools.XmlWriter;
+
 import org.w3c.dom.Element;
 
 import static org.apache.logging.log4j.tools.StringUtils.trimNullable;
diff --git a/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/exporter/AsciiDocExporter.java b/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/exporter/AsciiDocExporter.java
index d236e3d..23220dd 100644
--- a/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/exporter/AsciiDocExporter.java
+++ b/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/exporter/AsciiDocExporter.java
@@ -16,12 +16,6 @@
  */
 package org.apache.logging.log4j.tools.changelog.exporter;
 
-import org.apache.logging.log4j.tools.AsciiDocUtils;
-import org.apache.logging.log4j.tools.FileUtils;
-import org.apache.logging.log4j.tools.changelog.ChangelogEntry;
-import org.apache.logging.log4j.tools.changelog.ChangelogFiles;
-import org.apache.logging.log4j.tools.changelog.ChangelogRelease;
-
 import java.io.IOException;
 import java.io.UncheckedIOException;
 import java.nio.charset.StandardCharsets;
@@ -34,6 +28,14 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.stream.Collectors;
 
+import org.apache.logging.log4j.tools.AsciiDocUtils;
+import org.apache.logging.log4j.tools.FileUtils;
+import org.apache.logging.log4j.tools.changelog.ChangelogEntry;
+import org.apache.logging.log4j.tools.changelog.ChangelogFiles;
+import org.apache.logging.log4j.tools.changelog.ChangelogRelease;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
 public final class AsciiDocExporter {
 
     private static final String AUTO_GENERATION_WARNING_ASCIIDOC = "////\n" +
@@ -181,7 +183,10 @@ public final class AsciiDocExporter {
             throws IOException {
         final String asciiDocFilename = changelogReleaseAsciiDocFilename(release);
         final Path asciiDocFile = outputDirectory.resolve(asciiDocFilename);
-        Files.createDirectories(asciiDocFile.getParent());
+        Path asciiDocFileParent = asciiDocFile.getParent();
+        if (asciiDocFileParent != null) {
+            Files.createDirectories(asciiDocFileParent);
+        }
         final String asciiDoc = exportReleaseToAsciiDoc(release, introAsciiDoc, entries);
         final byte[] asciiDocBytes = asciiDoc.getBytes(StandardCharsets.UTF_8);
         Files.write(asciiDocFile, asciiDocBytes, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);
@@ -365,6 +370,7 @@ public final class AsciiDocExporter {
         }
     }
 
+    @SuppressFBWarnings("VA_FORMAT_STRING_USES_NEWLINE")
     private static String exportReleaseIndexToAsciiDoc(final List<ChangelogRelease> changelogReleases) {
         final StringBuilder stringBuilder = new StringBuilder();
         stringBuilder
diff --git a/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/importer/MavenChanges.java b/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/importer/MavenChanges.java
index 84b9814..1c76510 100644
--- a/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/importer/MavenChanges.java
+++ b/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/importer/MavenChanges.java
@@ -22,6 +22,7 @@ import java.util.List;
 import java.util.Locale;
 
 import org.apache.logging.log4j.tools.XmlReader;
+
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
diff --git a/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/importer/MavenChangesImporter.java b/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/importer/MavenChangesImporter.java
index 2494380..f376f08 100644
--- a/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/importer/MavenChangesImporter.java
+++ b/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/importer/MavenChangesImporter.java
@@ -16,14 +16,14 @@
  */
 package org.apache.logging.log4j.tools.changelog.importer;
 
-import org.apache.logging.log4j.tools.changelog.ChangelogEntry;
-import org.apache.logging.log4j.tools.changelog.ChangelogFiles;
-import org.apache.logging.log4j.tools.changelog.ChangelogRelease;
-
 import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.logging.log4j.tools.changelog.ChangelogEntry;
+import org.apache.logging.log4j.tools.changelog.ChangelogFiles;
+import org.apache.logging.log4j.tools.changelog.ChangelogRelease;
+
 import static org.apache.logging.log4j.tools.StringUtils.isBlank;
 
 public final class MavenChangesImporter {
diff --git a/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/releaser/ChangelogReleaser.java b/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/releaser/ChangelogReleaser.java
index f282706..72b0e7b 100644
--- a/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/releaser/ChangelogReleaser.java
+++ b/log4j-changelog/src/main/java/org/apache/logging/log4j/tools/changelog/releaser/ChangelogReleaser.java
@@ -16,12 +16,6 @@
  */
 package org.apache.logging.log4j.tools.changelog.releaser;
 
-import org.apache.logging.log4j.tools.AsciiDocUtils;
-import org.apache.logging.log4j.tools.FileUtils;
-import org.apache.logging.log4j.tools.VersionUtils;
-import org.apache.logging.log4j.tools.changelog.ChangelogFiles;
-import org.apache.logging.log4j.tools.changelog.ChangelogRelease;
-
 import java.io.IOException;
 import java.io.UncheckedIOException;
 import java.nio.charset.StandardCharsets;
@@ -29,7 +23,14 @@ import java.nio.file.Files;
 import java.nio.file.Path;
 import java.time.LocalDate;
 
+import org.apache.logging.log4j.tools.AsciiDocUtils;
+import org.apache.logging.log4j.tools.FileUtils;
+import org.apache.logging.log4j.tools.VersionUtils;
+import org.apache.logging.log4j.tools.changelog.ChangelogFiles;
+import org.apache.logging.log4j.tools.changelog.ChangelogRelease;
+
 import static java.time.format.DateTimeFormatter.ISO_DATE;
+
 import static org.apache.logging.log4j.tools.changelog.ChangelogFiles.releaseDirectory;
 
 public final class ChangelogReleaser {
diff --git a/pom.xml b/pom.xml
index d4b15d8..0b18eff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -65,13 +65,48 @@
     <!-- `project.build.outputTimestamp` is required for reproducible builds: https://maven.apache.org/guides/mini/guide-reproducible-builds.html -->
     <project.build.outputTimestamp>0</project.build.outputTimestamp>
 
+    <!-- dependency versions -->
+    <spotbugs.version>4.7.3</spotbugs.version>
+
     <!-- plugin versions -->
     <error-prone.version>2.16</error-prone.version>
+    <findsecbugs-plugin.version>1.12.0</findsecbugs-plugin.version>
     <flatten-maven-plugin.version>1.3.0</flatten-maven-plugin.version>
+    <spotbugs-maven-plugin.version>${spotbugs.version}.0</spotbugs-maven-plugin.version>
+    <spotless-maven-plugin.version>2.28.0</spotless-maven-plugin.version>
 
   </properties>
 
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>com.github.spotbugs</groupId>
+        <artifactId>spotbugs-annotations</artifactId>
+        <version>${spotbugs.version}</version>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
   <build>
+
+    <pluginManagement>
+      <plugins>
+
+        <plugin>
+          <groupId>com.github.spotbugs</groupId>
+          <artifactId>spotbugs-maven-plugin</artifactId>
+          <version>${spotbugs-maven-plugin.version}</version>
+        </plugin>
+
+        <plugin>
+          <groupId>com.diffplug.spotless</groupId>
+          <artifactId>spotless-maven-plugin</artifactId>
+          <version>${spotless-maven-plugin.version}</version>
+        </plugin>
+
+      </plugins>
+    </pluginManagement>
+
     <plugins>
 
       <plugin>
@@ -124,7 +159,101 @@
         </executions>
       </plugin>
 
-    </plugins>
-  </build>
+      <!-- Apache RAT (Release Audit Tool) check to verify licenses.
+           `apache-rat-plugin`: https://creadur.apache.org/rat/apache-rat-plugin/
+           Release Audit Tool: https://creadur.apache.org/rat/index.html -->
+      <plugin>
+        <groupId>org.apache.rat</groupId>
+        <artifactId>apache-rat-plugin</artifactId>
+        <configuration>
+          <consoleOutput>true</consoleOutput>
+          <excludes>
+            <exclude>**/target/**/*</exclude>
+            <exclude>.java-version</exclude>
+            <exclude>.mvn/jvm.config</exclude>
+            <!-- IntelliJ IDEA files: -->
+            <exclude>.idea/**/*</exclude>
+            <exclude>**/*.iml</exclude>
+          </excludes>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>verify</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+      <!-- Ensure that version for each dependency resolved during a build, is equal to or higher than all transitive dependency declarations.
+           A failure here requires adding the dependency to the dependency management. -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>enforce-upper-bound-deps</id>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+            <configuration>
+              <rules>
+                <requireUpperBoundDeps/>
+              </rules>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+
+  <!-- Configuration here must match the one in `.editorconfig`! -->
+  <plugin>
+    <groupId>com.diffplug.spotless</groupId>
+    <artifactId>spotless-maven-plugin</artifactId>
+    <executions>
+      <execution>
+        <id>default-spotless</id>
+        <phase>verify</phase>
+        <goals>
+          <goal>check</goal>
+        </goals>
+      </execution>
+    </executions>
+    <configuration>
+      <ratchetFrom>HEAD~31</ratchetFrom>
+      <java>
+        <importOrder>
+          <order>java,javax,org.apache.logging,,\#java,\#javax,\#org.apache.logging,\#</order>
+        </importOrder>
+      </java>
+    </configuration>
+  </plugin>
+
+  <plugin>
+    <groupId>com.github.spotbugs</groupId>
+    <artifactId>spotbugs-maven-plugin</artifactId>
+    <executions>
+      <execution>
+        <id>default-spotbugs</id>
+        <phase>verify</phase>
+        <goals>
+          <goal>check</goal>
+        </goals>
+      </execution>
+    </executions>
+    <configuration>
+      <plugins>
+        <plugin>
+          <groupId>com.h3xstream.findsecbugs</groupId>
+          <artifactId>findsecbugs-plugin</artifactId>
+          <version>${findsecbugs-plugin.version}</version>
+        </plugin>
+      </plugins>
+    </configuration>
+  </plugin>
+
+</plugins>
+
+</build>
 
 </project>


[logging-log4j-tools] 05/05: Create `log4j-tools-bom` and `log4j-tools-parent` POMs

Posted by vy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j-tools.git

commit 1e9e66f20f6e644d21e246d4fb25942be7fbc42a
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Wed Dec 21 10:16:45 2022 +0100

    Create `log4j-tools-bom` and `log4j-tools-parent` POMs
---
 log4j-changelog/pom.xml               |   3 +-
 pom.xml => log4j-tools-parent/pom.xml |  93 ++-------------
 pom.xml                               | 208 ++++++++--------------------------
 3 files changed, 62 insertions(+), 242 deletions(-)

diff --git a/log4j-changelog/pom.xml b/log4j-changelog/pom.xml
index a826146..bd71dd0 100644
--- a/log4j-changelog/pom.xml
+++ b/log4j-changelog/pom.xml
@@ -22,9 +22,10 @@
   <modelVersion>4.0.0</modelVersion>
 
   <parent>
-    <artifactId>log4j-tools</artifactId>
+    <artifactId>log4j-tools-parent</artifactId>
     <groupId>org.apache.logging.log4j.tools</groupId>
     <version>${revision}</version>
+    <relativePath>../log4j-tools-parent/pom.xml</relativePath>
   </parent>
 
   <artifactId>log4j-changelog</artifactId>
diff --git a/pom.xml b/log4j-tools-parent/pom.xml
similarity index 77%
copy from pom.xml
copy to log4j-tools-parent/pom.xml
index 4735c81..7ebb4a1 100644
--- a/pom.xml
+++ b/log4j-tools-parent/pom.xml
@@ -22,24 +22,18 @@
   <modelVersion>4.0.0</modelVersion>
 
   <parent>
-    <groupId>org.apache.logging</groupId>
-    <artifactId>logging-parent</artifactId>
-    <version>7</version>
+    <groupId>org.apache.logging.log4j.tools</groupId>
+    <artifactId>log4j-tools-bom</artifactId>
+    <version>${revision}</version>
   </parent>
 
-  <groupId>org.apache.logging.log4j.tools</groupId>
-  <artifactId>log4j-tools</artifactId>
+  <artifactId>log4j-tools-parent</artifactId>
   <packaging>pom</packaging>
   <version>${revision}</version>
 
-  <modules>
-    <module>log4j-changelog</module>
-  </modules>
-
   <properties>
 
-    <!-- common properties -->
-    <revision>0.1.0-SNAPSHOT</revision>
+    <!-- project properties -->
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
@@ -53,13 +47,16 @@
     <!-- `project.build.outputTimestamp` is required for reproducible builds: https://maven.apache.org/guides/mini/guide-reproducible-builds.html -->
     <project.build.outputTimestamp>0</project.build.outputTimestamp>
 
+    <!-- disable `maven-site-plugin`-->
+    <maven.site.skip>true</maven.site.skip>
+    <maven.site.deploy.skip>true</maven.site.deploy.skip>
+
     <!-- dependency versions -->
     <spotbugs.version>4.7.3</spotbugs.version>
 
     <!-- plugin versions -->
     <error-prone.version>2.16</error-prone.version>
     <findsecbugs-plugin.version>1.12.0</findsecbugs-plugin.version>
-    <flatten-maven-plugin.version>1.3.0</flatten-maven-plugin.version>
     <spotbugs-maven-plugin.version>${spotbugs.version}.0</spotbugs-maven-plugin.version>
     <spotless-maven-plugin.version>2.28.0</spotless-maven-plugin.version>
 
@@ -138,7 +135,7 @@
             </goals>
           </execution>
           <execution>
-            <id>clean-revision</id>
+            <id>clean-flattened-revision</id>
             <phase>clean</phase>
             <goals>
               <goal>clean</goal>
@@ -253,74 +250,4 @@
 
   </build>
 
-  <distributionManagement>
-    <!-- `repository` from parent `org.apache.logging:logging-parent` (id: `apache.releases.https`) -->
-    <!-- `snapshotRepository` from parent `org.apache.logging:logging-parent` (id: `apache.snapshots.https`) -->
-  </distributionManagement>
-
-  <scm>
-    <url>https://github.com/apache/logging-log4j-tools</url>
-    <connection>scm:git:git@github.com:apache/logging-log4j-tools.git</connection>
-    <developerConnection>scm:git:git@github.com:apache/logging-log4j-tools.git</developerConnection>
-    <tag>HEAD</tag>
-  </scm>
-
-  <url>https://github.com/apache/logging-log4j-tools</url>
-
-  <issueManagement>
-    <system>GitHub Issues</system>
-    <url>https://github.com/apache/logging-log4j-tools/issues</url>
-  </issueManagement>
-
-  <licenses>
-    <license>
-      <name>Apache License, Version 2.0</name>
-      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
-      <distribution>repo</distribution>
-      <comments>A business-friendly OSS license</comments>
-    </license>
-  </licenses>
-
-  <organization>
-    <name>Apache Software Foundation</name>
-    <url>https://apache.org</url>
-  </organization>
-
-  <inceptionYear>2022</inceptionYear>
-
-  <developers>
-
-    <developer>
-      <id>rgoers</id>
-      <name>Ralph Goers</name>
-      <email>rgoers@apache.org</email>
-      <organization>Nextiva</organization>
-      <roles>
-        <role>PMC Member</role>
-      </roles>
-      <timezone>America/Phoenix</timezone>
-    </developer>
-
-    <developer>
-      <id>vy</id>
-      <name>Volkan Yazıcı</name>
-      <email>vy@apache.org</email>
-      <roles>
-        <role>PMC Member</role>
-      </roles>
-      <timezone>Europe/Amsterdam</timezone>
-    </developer>
-
-    <developer>
-      <id>pkarwasz</id>
-      <name>Piotr P. Karwasz</name>
-      <email>pkarwasz@apache.org</email>
-      <roles>
-        <role>PMC Member</role>
-      </roles>
-      <timezone>Europe/Warsaw</timezone>
-    </developer>
-
-  </developers>
-
 </project>
diff --git a/pom.xml b/pom.xml
index 4735c81..78a7e8f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,6 +19,15 @@
          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">
 
+  <!-- ██     ██  █████  ██████  ███    ██ ██ ███    ██  ██████  ██
+       ██     ██ ██   ██ ██   ██ ████   ██ ██ ████   ██ ██       ██
+       ██  █  ██ ███████ ██████  ██ ██  ██ ██ ██ ██  ██ ██   ███ ██
+       ██ ███ ██ ██   ██ ██   ██ ██  ██ ██ ██ ██  ██ ██ ██    ██
+        ███ ███  ██   ██ ██   ██ ██   ████ ██ ██   ████  ██████  ██
+
+       `log4j-tools` project modules should use `log4j-tools-parent` as their parents, not this POM!
+       This POM constitutes the BOM to be imported by applications using `log4j-tools` project modules. -->
+
   <modelVersion>4.0.0</modelVersion>
 
   <parent>
@@ -28,21 +37,24 @@
   </parent>
 
   <groupId>org.apache.logging.log4j.tools</groupId>
-  <artifactId>log4j-tools</artifactId>
+  <artifactId>log4j-tools-bom</artifactId>
   <packaging>pom</packaging>
   <version>${revision}</version>
 
   <modules>
+
+    <!-- the parent POM must come first: -->
+    <module>log4j-tools-parent</module>
+
+    <!-- Modules here must have a corresponding entry in `dependencyManagement > dependencies` block below! -->
     <module>log4j-changelog</module>
+
   </modules>
 
   <properties>
 
-    <!-- common properties -->
+    <!-- project version -->
     <revision>0.1.0-SNAPSHOT</revision>
-    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
-    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
 
     <!-- `minimalJavaBuildVersion` is employed by `org.apache:apache`, which is the parent of `org.apache.logging:logging-parent`, which is the parent of us.
          `minimalJavaBuildVersion` is used for enforcing the compiler version.
@@ -53,24 +65,19 @@
     <!-- `project.build.outputTimestamp` is required for reproducible builds: https://maven.apache.org/guides/mini/guide-reproducible-builds.html -->
     <project.build.outputTimestamp>0</project.build.outputTimestamp>
 
-    <!-- dependency versions -->
-    <spotbugs.version>4.7.3</spotbugs.version>
-
     <!-- plugin versions -->
-    <error-prone.version>2.16</error-prone.version>
-    <findsecbugs-plugin.version>1.12.0</findsecbugs-plugin.version>
     <flatten-maven-plugin.version>1.3.0</flatten-maven-plugin.version>
-    <spotbugs-maven-plugin.version>${spotbugs.version}.0</spotbugs-maven-plugin.version>
-    <spotless-maven-plugin.version>2.28.0</spotless-maven-plugin.version>
 
   </properties>
 
+  <!-- `dependencyManagement` must only contain `log4j-tools` modules and nothing else!
+       Modules here must have a corresponding entry in `modules` block above! -->
   <dependencyManagement>
     <dependencies>
       <dependency>
-        <groupId>com.github.spotbugs</groupId>
-        <artifactId>spotbugs-annotations</artifactId>
-        <version>${spotbugs.version}</version>
+        <groupId>org.apache.logging.log4j.tools</groupId>
+        <artifactId>log4j-changelog</artifactId>
+        <version>${project.version}</version>
       </dependency>
     </dependencies>
   </dependencyManagement>
@@ -79,174 +86,54 @@
 
     <pluginManagement>
       <plugins>
-
         <plugin>
-          <groupId>com.github.spotbugs</groupId>
-          <artifactId>spotbugs-maven-plugin</artifactId>
-          <version>${spotbugs-maven-plugin.version}</version>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>flatten-maven-plugin</artifactId>
+          <version>${flatten-maven-plugin.version}</version>
         </plugin>
-
-        <plugin>
-          <groupId>com.diffplug.spotless</groupId>
-          <artifactId>spotless-maven-plugin</artifactId>
-          <version>${spotless-maven-plugin.version}</version>
-        </plugin>
-
       </plugins>
     </pluginManagement>
 
     <plugins>
 
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <release>${java.version}</release>
-          <encoding>${project.build.sourceEncoding}</encoding>
-          <compilerArgs>
-            <arg>-Xlint:all</arg>
-            <arg>-XDcompilePolicy=simple</arg>
-            <arg>-Xplugin:ErrorProne</arg>
-          </compilerArgs>
-          <annotationProcessorPaths>
-            <path>
-              <groupId>com.google.errorprone</groupId>
-              <artifactId>error_prone_core</artifactId>
-              <version>${error-prone.version}</version>
-            </path>
-          </annotationProcessorPaths>
-        </configuration>
-      </plugin>
-
-      <!-- Resolves `revision` property prior to deployment.
-           Skipping this step would result in artifacts not consumable by Maven.
-           https://maven.apache.org/maven-ci-friendly.html#install-deploy -->
+      <!-- BOMs should ideally _only_ contain dependencies for modules of the project.
+           No invasive properties or plugin/dependency management – either from the BOM itself or its parent.
+           The following `flatten-maven-plugin` exactly performs that trimming operation. -->
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>flatten-maven-plugin</artifactId>
         <version>${flatten-maven-plugin.version}</version>
-        <configuration>
-          <updatePomFile>true</updatePomFile>
-          <flattenMode>resolveCiFriendliesOnly</flattenMode>
-        </configuration>
+        <inherited>false</inherited>
         <executions>
           <execution>
-            <id>flatten-revision</id>
+            <id>flatten-bom</id>
             <phase>process-resources</phase>
             <goals>
               <goal>flatten</goal>
             </goals>
-          </execution>
-          <execution>
-            <id>clean-revision</id>
-            <phase>clean</phase>
-            <goals>
-              <goal>clean</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-
-      <!-- Apache RAT (Release Audit Tool) check to verify licenses.
-           `apache-rat-plugin`: https://creadur.apache.org/rat/apache-rat-plugin/
-           Release Audit Tool: https://creadur.apache.org/rat/index.html -->
-      <plugin>
-        <groupId>org.apache.rat</groupId>
-        <artifactId>apache-rat-plugin</artifactId>
-        <configuration>
-          <consoleOutput>true</consoleOutput>
-          <excludes>
-            <exclude>**/target/**/*</exclude>
-            <exclude>.java-version</exclude>
-            <exclude>.mvn/jvm.config</exclude>
-            <!-- IntelliJ IDEA files: -->
-            <exclude>.idea/**/*</exclude>
-            <exclude>**/*.iml</exclude>
-          </excludes>
-        </configuration>
-        <executions>
-          <execution>
-            <phase>verify</phase>
-            <goals>
-              <goal>check</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-
-      <!-- Ensure that version for each dependency resolved during a build, is equal to or higher than all transitive dependency declarations.
-           A failure here requires adding the dependency to the dependency management. -->
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-enforcer-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>enforce-upper-bound-deps</id>
-            <goals>
-              <goal>enforce</goal>
-            </goals>
             <configuration>
-              <rules>
-                <requireUpperBoundDeps/>
-              </rules>
+              <flattenMode>bom</flattenMode>
+              <!-- POM `ElementHandling` is pretty cryptic: https://www.mojohaus.org/flatten-maven-plugin/apidocs/org/codehaus/mojo/flatten/ElementHandling.html
+                   Trial-and-error has shown that we should use either `remove` or `interpolate`.
+                   `remove` simply removes the element.
+                   `interpolate` takes the element from the original POM with variables interpolated.
+                   Avoid using `resolve`, which uses the effective POM where inherited changes from the parent are also incorporated. -->
+              <pomElements>
+                <properties>remove</properties>
+                <repositories>remove</repositories>
+                <distributionManagement>remove</distributionManagement>
+                <dependencyManagement>interpolate</dependencyManagement>
+              </pomElements>
             </configuration>
           </execution>
-        </executions>
-      </plugin>
-
-      <!-- Configuration here must match the one in `.editorconfig`! -->
-      <plugin>
-        <groupId>com.diffplug.spotless</groupId>
-        <artifactId>spotless-maven-plugin</artifactId>
-        <executions>
           <execution>
-            <id>default-spotless</id>
-            <phase>verify</phase>
-            <goals>
-              <goal>check</goal>
-            </goals>
-          </execution>
-        </executions>
-        <configuration>
-          <java>
-            <licenseHeader>
-              <file>${maven.multiModuleProjectDirectory}/spotless-license-header.txt</file>
-            </licenseHeader>
-            <trimTrailingWhitespace/>
-            <endWithNewline/>
-            <removeUnusedImports/>
-            <indent>
-              <spaces>true</spaces>
-              <spacesPerTab>4</spacesPerTab>
-            </indent>
-            <importOrder>
-              <order>java,javax,org.apache.logging,,\#java,\#javax,\#org.apache.logging,\#</order>
-            </importOrder>
-          </java>
-        </configuration>
-      </plugin>
-
-      <plugin>
-        <groupId>com.github.spotbugs</groupId>
-        <artifactId>spotbugs-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>default-spotbugs</id>
-            <phase>verify</phase>
+            <id>clean-flattened-bom</id>
+            <phase>clean</phase>
             <goals>
-              <goal>check</goal>
+              <goal>clean</goal>
             </goals>
           </execution>
         </executions>
-        <configuration>
-          <plugins>
-            <plugin>
-              <groupId>com.h3xstream.findsecbugs</groupId>
-              <artifactId>findsecbugs-plugin</artifactId>
-              <version>${findsecbugs-plugin.version}</version>
-            </plugin>
-          </plugins>
-        </configuration>
       </plugin>
 
     </plugins>
@@ -267,6 +154,11 @@
 
   <url>https://github.com/apache/logging-log4j-tools</url>
 
+  <ciManagement>
+    <system>GitHub Actions</system>
+    <url>https://github.com/apache/logging-log4j-tools/actions</url>
+  </ciManagement>
+
   <issueManagement>
     <system>GitHub Issues</system>
     <url>https://github.com/apache/logging-log4j-tools/issues</url>