apache / logging-log4j2

Apache Log4j 2 is a versatile, feature-rich, efficient logging API and backend for Java.
https://logging.apache.org/log4j/2.x/
Apache License 2.0
3.34k stars 1.59k forks source link

Update javax dependencies to latest jakarta versions #1504

Closed mkoncek closed 1 year ago

mkoncek commented 1 year ago

I would like this project to switch to using jakarta dependencies instead of the old javax versions. This would help us get rid of dependencies on old packages in Fedora.

ppkarwasz commented 1 year ago

@mkoncek,

Which Jakarta EE specifications are you referring to? We chose to release separate modules to deal with the Java/Jakarta switch:

We didn't jakartify the JMS appender and log4j-taglib due to lack of interest on the part of users, but we are open to PRs.

mkoncek commented 1 year ago

Sorry I forgot to mention them: I was talking about javax/jakarta activation and mail. I wanted to open a PR but I kept encountering build errors. Last one was:

[INFO] ---------------< org.apache.logging.log4j:log4j-jmx-gui >---------------
[INFO] Building Apache Log4j JMX GUI 2.20.0                             [25/49]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Apache Log4j 2 2.20.0:
[INFO] 
[INFO] Apache Log4j 2 ..................................... SUCCESS [  4.972 s]
[INFO] Apache Log4j API Java 9 support .................... SUCCESS [  1.714 s]
[INFO] Apache Log4j API ................................... SUCCESS [  5.537 s]
[INFO] Apache Log4j Implementation Java 9 support ......... SUCCESS [  1.294 s]
[INFO] Apache Log4j Core .................................. SUCCESS [ 13.609 s]
[INFO] Apache Log4j API Tests ............................. SUCCESS [  3.008 s]
[INFO] Apache Log4j Core Tests ............................ SUCCESS [  4.816 s]
[INFO] Apache Log4j 1.x Compatibility API ................. SUCCESS [  4.423 s]
[INFO] Apache Log4j App Server Support .................... SUCCESS [  1.093 s]
[INFO] Apache Log4j BOM ................................... SUCCESS [  0.188 s]
[INFO] Apache Log4j to SLF4J Adapter ...................... SUCCESS [  1.609 s]
[INFO] Apache Log4j SLF4J Binding ......................... SUCCESS [  1.619 s]
[INFO] Apache Log4j Cassandra ............................. SUCCESS [  2.572 s]
[INFO] Apache Log4j Core Integration Tests ................ SUCCESS [  0.555 s]
[INFO] Apache Log4j CouchDB ............................... SUCCESS [  1.597 s]
[INFO] Apache Log4j Docker Library ........................ SUCCESS [  1.382 s]
[INFO] Apache Log4j Commons Logging Bridge ................ SUCCESS [  1.087 s]
[INFO] Apache Log4j Flume Bridge .......................... SUCCESS [  4.223 s]
[INFO] Apache Log4j Streaming Interface ................... SUCCESS [  1.991 s]
[INFO] Apache Log4j Jakarta SMTP .......................... SUCCESS [  1.492 s]
[INFO] Apache Log4j Jakarta Web ........................... SUCCESS [  1.700 s]
[INFO] Apache Log4j JPA ................................... SUCCESS [  1.863 s]
[INFO] Apache Log4j JDK Platform Logging Adapter .......... SUCCESS [  1.277 s]
[INFO] Apache Log4j JDBC DBCP 2 ........................... SUCCESS [  1.443 s]
[INFO] Apache Log4j JMX GUI ............................... FAILURE [  0.008 s]
[INFO] Apache Log4j JUL Adapter ........................... SKIPPED
[INFO] Apache Log4j Kubernetes Library .................... SKIPPED
[INFO] Apache Log4j Layout for JSON template .............. SKIPPED
[INFO] Apache Log4j Layout for JSON template Tests ........ SKIPPED
[INFO] Apache Log4j MongoDB 3 ............................. SKIPPED
[INFO] Apache Log4j MongoDB 4 ............................. SKIPPED
[INFO] Apache Log4j to JUL Bridge ......................... SKIPPED
[INFO] Apache Log4j OSGi .................................. SKIPPED
[INFO] Apache Log4J Performance Tests ..................... SKIPPED
[INFO] Apache Log4j Samples ............................... SKIPPED
[INFO] Apache Log4j Samples: Flume - Common ............... SKIPPED
[INFO] Apache Log4j Samples: Flume - Remote ............... SKIPPED
[INFO] Apache Log4j Samples: Flume - Embedded ............. SKIPPED
[INFO] Apache Log4j Samples: Configuration ................ SKIPPED
[INFO] Apache Log4j Samples: LoggerProperties ............. SKIPPED
[INFO] Apache Log4j SLF4J 2.0 Binding ..................... SKIPPED
[INFO] Apache Log4j Spring Boot Support ................... SKIPPED
[INFO] Apache Log4j Spring Cloud Config Support ........... SKIPPED
[INFO] Apache Log4j Spring Cloud Config Client Support .... SKIPPED
[INFO] Apache Log4j Spring Cloud Config Samples ........... SKIPPED
[INFO] Apache Log4j Sample Configuration Service .......... SKIPPED
[INFO] Apache Log4j Spring Cloud Config Sample Application  SKIPPED
[INFO] Apache Log4j Web ................................... SKIPPED
[INFO] Apache Log4j Tag Library ........................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:06 min
[INFO] Finished at: 2023-06-07T08:51:59+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project log4j-jmx-gui: Could not resolve dependencies for project org.apache.logging.log4j:log4j-jmx-gui:jar:2.20.0: Could not find artifact com.sun:jconsole:jar:1.7.0 at specified path /usr/lib/jvm/java-17-openjdk-17.0.6.0.10-1.fc38.x86_64/../lib/jconsole.jar -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :log4j-jmx-gui

I set up toolchains to point to JDK 1.8.0 and 11, but my default JDK is 17...

ppkarwasz commented 1 year ago

@mkoncek,

Compiling branch 2.x is hard. You need to set JAVA_HOME to the path of your JDK 8 installation or exclude log4j-jmx-gui from the build.

The javax.activation-api and javax.mail-api are required to compile log4j-core, but are not required at runtime if you also deploy log4j-jakarta-smtp.

ppkarwasz commented 1 year ago

I split this issue into #1524, #1526 and #1528.