Skip to content

Conversation

@edwgiz
Copy link

@edwgiz edwgiz commented Oct 19, 2021

No description provided.

@edwgiz edwgiz closed this Oct 19, 2021
@edwgiz edwgiz reopened this Oct 19, 2021
@vy
Copy link
Member

vy commented Oct 19, 2021

Fantastic work @edwgiz, thanks so much!

One more question: I am a MANIFEST.MF noob, is the empty file necessary?


## Overview

This module includes the transformer for [Apache Maven Shade Plugin](https://maven.apache.org/plugins/maven-shade-plugin/), that concatenates `Log4j2Plugins.dat` files,
Copy link
Member

Choose a reason for hiding this comment

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

Before technically explaining what the transformer does, maybe it is good to have some introduction to the problem: "Log4j 2 is composed of plugins and they are loaded from Log4j2Plugins.dat file found in the classpath at runtime. Shading overrides the cache files provided by each individual module. For instance, -web and -core, etc. ... So if you happen to shade libraries providing Log4j 2 plugins, you need this thing." Something along these lines.

It is also important to keep the Log4j 2 emphasis here. Since, 1) Log4j 1 doesn't have plugins and 2) Log4j 3 plugins doesn't suffer from this problem.

Copy link
Member

Choose a reason for hiding this comment

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

a) the comments can be improved after the PR is pushed. b) There is no Log4j 3. It will be Log4j 2 3.0

Copy link
Author

Choose a reason for hiding this comment

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

Thanks @vy @rgoers ,
please find the code changes in my next commit

<version>2.14.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-maven-plugins-shade-transformer</artifactId>
Copy link
Member

Choose a reason for hiding this comment

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

I think this is a good spot to talk about the module naming and hiearchy. @edwgiz, I see that you have created a nested module structure: log4j-maven-plugins-shade-transformer under log4j-maven-plugins. I share my remarks below.

  1. I see some things are named shade and some shaded. I think we need to stick to one.
  2. I don't think there is a need for a nested structure; log4j-maven-plugins-shade-transformer at the top is good enough.
  3. I propose naming the module to log4j-maven-shade-plugin-extensions. Because,
    1. log4j- prefix in the artifact IDs is a convention we stick to everywhere, I don't see why this needs to be an exception.
    2. I see -extensions suffix is used by others extending Maven Shade plugin too.
  4. Whatever the consensus on the module name is, JPMS module name and Java package path need to reflect that too.

@jvz, @rgoers, @garydgregory, comments?

Copy link
Member

Choose a reason for hiding this comment

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

Typically, the groupId is org.apache.logging.log4j for everything related to log4j. I'm not sure we need the maven distinction on the groupId.
I am fine with the package name being org.apache.logging.log4j.maven.
I am fine with the artifactId. The module should be the same (which it is).
I am fine with nesting this plugin under log4j-maven-plugins. Although we may never have another Maven plugin I see no reason to preclude it.

This jar doesn't need JPMS support. It is a jar to be added to the maven shade plugin, which doesn't rely on JPMS (thank goodness). That said, the package name should not overlap any other potential maven plugins, so the full package name of org.apache.logging.log4j.maven.shaded.transformer is correct, unless we decide that "shade" should be used everywhere.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks @vy @rgoers ,
please find the code changes in my next commit

@edwgiz
Copy link
Author

edwgiz commented Oct 19, 2021 via email

Maven project structure simplification;
Artifact and java package renaming;
Documentation improvement
@ppkarwasz
Copy link
Contributor

@edwgiz,

Sorry it took us so much time to merge your PR. In the meantime we rearranged Github repositories a bit. Would you mind resubmitting your plugin to logging-log4j-transform? It will perfectly integrate into the features we plan to develop there.

@edwgiz
Copy link
Author

edwgiz commented Jan 10, 2023

Hello, @ppkarwasz

That's good news, I will prepare the merge this week

@ppkarwasz
Copy link
Contributor

This PR was moved to logging-log4j-transform#2.

@ppkarwasz ppkarwasz closed this Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants