Graylog2 / graylog2-server

Free and open log management
https://www.graylog.org
Other
7.4k stars 1.06k forks source link

Compile Error on Version 5.2.0+ #17531

Closed HenryTheSir closed 11 months ago

HenryTheSir commented 11 months ago

Expected Behavior

Graylog can be compiled from Sourcecode

Current Behavior

Compile fails with InvocationTargetException

Error Code:

14:05:53  [INFO] ------------------------------------------------------------------------
14:05:53  [INFO] Reactor Summary for Graylog Parent POM 5.2.0:
14:05:53  [INFO] 
14:05:53  [INFO] Graylog Parent POM ................................. SUCCESS [  8.825 s]
14:05:53  [INFO] Graylog Project Parent POM ......................... SUCCESS [  0.045 s]
14:05:53  [INFO] Graylog ............................................ FAILURE [ 39.046 s]
14:05:53  [INFO] Graylog Plugin Parent POM .......................... SKIPPED
14:05:53  [INFO] graylog-storage-elasticsearch7 ..................... SKIPPED
14:05:53  [INFO] graylog-storage-opensearch2 ........................ SKIPPED
14:05:53  [INFO] full-backend-tests ................................. SKIPPED
14:05:53  [INFO] Graylog Plugin with Web support Parent POM ......... SKIPPED
14:05:53  [INFO] graylog-plugin-archetype ........................... SKIPPED
14:05:53  [INFO] Graylog Binary Distribution Tarball ................ SKIPPED
14:05:53  [INFO] ------------------------------------------------------------------------
14:05:53  [INFO] BUILD FAILURE
14:05:53  [INFO] ------------------------------------------------------------------------
14:05:53  [INFO] Total time:  49.950 s
14:05:53  [INFO] Finished at: 2023-11-30T14:05:53+01:00
14:05:53  [INFO] ------------------------------------------------------------------------
14:05:53  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project graylog2-server: Fatal error compiling: Error while executing the compiler. InvocationTargetException: class com.google.errorprone.BaseErrorProneJavaCompiler (in unnamed module @0x16b713dd) cannot access class com.sun.tools.javac.api.BasicJavacTask (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.api to unnamed module @0x16b713dd -> [Help 1]

Tests with modified mvn jvm.config file were not successfull: --add-exports=com.sun.tools.javac.api=ALL-UNNAMED" in ~/.mvn/jvm.config

Compilation of versions prior 5.2 are working fine.

Possible Solution

Steps to Reproduce (for bugs)

  1. Try to compile current 5.2.0 or 5.2.1 release directly from source
  2. wait
  3. observe error

Context

To compile internal plugins the graylog repo needs to be compiled localy, as its currently not possible upgrades to 5.2 are stuck.

Your Environment

thll commented 11 months ago

@HenryTheSir this works for me. To narrow it down: are you running the mvn command on a fresh checkout of this repository and directly in the top level directory? I'm asking because that's where maven will look for the .mvn/jvm.config file and we ship one which has the required settings.

HenryTheSir commented 11 months ago

Hi @thll ,

thanks for the hint. The Folder and config got lost transfering to our air gapped build system. (Windows 😑).

If the file and config is present the build runs successfully - thanks for your fast answer and support!

best regards