Closed noname713705 closed 2 years ago
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.
Fixed in 75907003bbf
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..)
Name: org/apache/log4j/
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:
Sample code for programatically acessing the version (as for other maven artifacts), but only works with a built jar: