WrenSecurity / wrensec-commons

Community fork of ForgeRock Commons, which contains common utility code used by multiple products originally developed by ForgeRock.
http://wrensecurity.org
0 stars 10 forks source link

Illegal reflection warnings when building with Java 11 #27

Open krystofNovotny opened 3 years ago

krystofNovotny commented 3 years ago

Affected version: 22.1.0

When building the commons project - 2 error warnings pops up (see below).

They are caused by:

The goal of this issue is to propose clean solution for those problems, spawning another issue for each of them.

INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ chf-http-servlet ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.forgerock.http.servlet.ServletTest
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[ERROR] WARNING: An illegal reflective access operation has occurred
[ERROR] WARNING: Illegal reflective access by org.mockito.cglib.core.ReflectUtils$2 (file:/home/krystof/.m2/repository/org/mockito/mockito-all/1.10.19/mockito-all-1.10.19.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
[ERROR] WARNING: Please consider reporting this to the maintainers of org.mockito.cglib.core.ReflectUtils$2
[ERROR] WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
[ERROR] WARNING: All illegal access operations will be denied in a future release
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.109 s - in org.forgerock.http.servlet.ServletTest
[ESC[1;34mINFOESC[m]  T E S T S
[ESC[1;34mINFOESC[m] -------------------------------------------------------
[ESC[1;34mINFOESC[m] Running ESC[1mTestSuiteESC[m
[ESC[1;31mERRORESC[m] WARNING: An illegal reflective access operation has occurred
[ESC[1;31mERRORESC[m] WARNING: Illegal reflective access by org.forgerock.audit.handlers.jms.JndiJmsContextManagerTest (file:/home/krystof/orchi/wren/wrensec-commons/audit/forgerock-audit-handler-jms/target/test-classes/) to method javax.naming.spi.NamingManager.getInitialContextFactoryBuilder()
[ESC[1;31mERRORESC[m] WARNING: Please consider reporting this to the maintainers of org.forgerock.audit.handlers.jms.JndiJmsContextManagerTest
[ESC[1;31mERRORESC[m] WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
[ESC[1;31mERRORESC[m] WARNING: All illegal access operations will be denied in a future release
[ESC[1;34mINFOESC[m] ESC[1;32mTests run: ESC[0;1;32m8ESC[m, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.803 s - in ESC[1mTestSuiteESC[m
[ESC[1;34mINFOESC[m] 
[ESC[1;34mINFOESC[m] Results:
[ESC[1;34mINFOESC[m] 
[ESC[1;34mINFOESC[m] ESC[1;32mTests run: 8, Failures: 0, Errors: 0, Skipped: 0ESC[m