Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions log4j-mongodb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,6 @@
<configuration>
<skip>true</skip>
</configuration>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit-jupiter.version}</version>
</dependency>
</dependencies>
</plugin>

</plugins>
Expand Down
46 changes: 46 additions & 0 deletions log4j-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,52 @@
</executions>
</plugin>

<!--
~ Drop the <build> section from flattened POMs.
~ Keeps the consumer POM minimal and prevents flattened build-only properties
~ (e.g., `error-prone.version`) from causing resolution problems to users.
~
~ Ref: https://github.com/apache/logging-log4j2/issues/3779
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<executions>
<!-- First use the special `resolveCiFriendliesOnly` mode to replace the special `${revision}` property with the actual version.
This is necessary because `flatten` mode does not support `ci-friendly` versions. -->
<execution>
<id>flatten-revision</id>
</execution>
<execution>
<id>flatten</id>
<goals>
<goal>flatten</goal>
</goals>
<phase>process-resources</phase>
<configuration>
<!-- Use 'clean' as a base, then selectively retain key elements -->
<flattenMode>clean</flattenMode>
<pomElements>
<!-- Keep parent to maintain inheritance from log4j-bom and ancestors -->
<parent>keep</parent>

<!-- Retain meaningful module metadata -->
<name>expand</name>
<description>expand</description>

<!-- Expand URL to prevent default behavior of appending artifactId -->
<url>expand</url>

<!-- Keep dependencyManagement and dependencies, interpolating property-based versions -->
<dependencyManagement>interpolate</dependencyManagement>
<dependencies>interpolate</dependencies>
</pomElements>
</configuration>
</execution>

</executions>
</plugin>

</plugins>
</build>

Expand Down
46 changes: 46 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,37 @@
</configuration>
</plugin>

<!--
~ Memento rules to remove overrides from child modules, whenever the changes are moved to `logging-parent`.
~
~ When empty, please comment this execution out, but do not delete it!
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>remove-overrides</id>
<goals>
<goal>enforce</goal>
</goals>
<!-- Wait until we retrieve `parent.version` property in `build-helper-maven-plugin` below -->
<phase>initialize</phase>
<inherited>false</inherited>
<configuration>
<rules>
<requireProperty>
<property>parent.version</property>
<regex>12\.1\.1</regex>
<regexMessage>Remember to remove overrides from child modules, whenever the changes are moved to `logging-parent`:
* Remove the override `flatten-maven-plugin` configuration from `log4j-parent/pom.xml`.</regexMessage>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we do this? Are we intending to move this "non-BOM flattening" logic to logging-parent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the long term, I think we should move this to logging-parent, don't you agree?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. Could you then instead move this PR to logging-parent instead, please? We have full control over both projects and their releases. Maybe I'm missing out on certain details, but I am not able to see why we shall temporarily fix this only for Log4j, whereas fixing it in logging-parent will benefit all its children.

</requireProperty>
</rules>
</configuration>
</execution>
</executions>
</plugin>

<!-- ███████ ████████ █████ ██████ ████████ ███████ ██ ████████ ███████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
███████ ██ ███████ ██████ ██ ███████ ██ ██ █████
Expand Down Expand Up @@ -657,6 +688,21 @@
<locale>en_US</locale>
</configuration>
</execution>
<!-- Used by `maven-enforcer-plugin` above -->
<execution>
<id>capture-parent-version</id>
<goals>
<goal>regex-property</goal>
</goals>
<phase>validate</phase>
<inherited>false</inherited>
<configuration>
<name>parent.version</name>
<value>${project.parent.version}</value>
<regex>^(.+)$</regex>
<replacement>$1</replacement>
</configuration>
</execution>
</executions>
</plugin>

Expand Down
Loading