arquillian / arquillian-core

Arquillian provides a component model for integration tests, which includes dependency injection and container life cycle management. Instead of managing a runtime in your test, Arquillian brings your test to the runtime.
http://arquillian.org
Apache License 2.0
369 stars 194 forks source link

Add --add-opens to surefire for running tests on Java SE 17+ #565

Closed starksm64 closed 3 months ago

starksm64 commented 3 months ago

Short description of what this resolves:

The CDIInjectionEnricherTestCase relies on Weld being able to make protected/private fields accessible. This requires additional access permissions when running under Java SE 17+

Changes proposed in this pull request:

Add an override to the surefire plugin configuration to include a --add-opens java.base/java.lang=ALL-UNNAMED

Fixes #564

jamezp commented 3 months ago

This probably needs to be in a profile where we check the Java version. That said, I wonder at what point we drop Java 8 support :)

starksm64 commented 3 months ago

This probably needs to be in a profile where we check the Java version. That said, I wonder at what point we drop Java 8 support :)

Certainly we will drop it when the main branch goes to 2.0 and SE 21 as the baseline.

Pulling this code out into a separate legacy repo will also simplify things. For now I have added the profile.