You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually, it is broken since log4j:log4j:1.2.15 and above.
The problem is that, due to error in the generated META-INF/MANIFEST.MF , it is not possible to determine the version of log4j / reload4j programatically.
This is due to an invalide Name: entry in the manifest.
This is a problem because it is then difficult to log, or access the reload4j version from code (for example, to check if you let the CVEs behind..)
version detection works with: Name: org/apache/log4j/
but is broken with the current: Name: org.apache.log4j
I'm not sure if I can make a pull request on reload4j, put the following git diff fixes the problem for me:
The <addDefaultImplementationEntries>true</addDefaultImplementationEntries> is indeed useful.
Regarding the PatternLayout.class.getPackage().getImplementationVersion(); call, once addDefaultImplementationEntries is effective, you do not need to add the name entry.
Also note that, testLog4jVersion() test must be located outside the reload4j project/module to let the the jar plugin do its work.
Activity
ceki commentedon Feb 7, 2022
The
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>is indeed useful.Regarding the
PatternLayout.class.getPackage().getImplementationVersion();call, onceaddDefaultImplementationEntriesis effective, you do not need to add thenameentry.Also note that,
testLog4jVersion()test must be located outside the reload4j project/module to let the the jar plugin do its work.ceki commentedon Feb 7, 2022
Fixed in 7590700