jakartaee / authentication

Jakarta Authentication
https://eclipse.org/ee4j/jaspic
Other
22 stars 30 forks source link

TCK: common module doesn't declare or inherit maven-compiler-plugin #214

Open brideck opened 1 month ago

brideck commented 1 month ago

The Authentication TCK is a multi-module Maven project. Accordingly, the top-level pom uses the <pluginManagement> block to define the levels of various plugins, etc. that the rest of the project should use, including:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.13.0</version>
</plugin>

The common module, which is the first one declared/processed in the top-level pom, neither declares a <parent> (and thus doesn't inherit the version of compiler plugin defined there) nor defines its own usage of the compiler plugin. This results in Maven falling back on using its default levels (as defined in maven-core.jar#META-INF/plexus/default-bindings.xml). Prior to Maven 3.9.0, the default version of the maven-compiler-plugin is the ancient 3.1, which doesn't recognize <maven.compiler.release>17 as a viable option. This results in the following failure:

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] Source option 5 is no longer supported. Use 8 or later.
[ERROR] Target option 5 is no longer supported. Use 8 or later.
[INFO] 2 errors 
[INFO] -------------------------------------------------------------

The common module needs to be updated to either a) inherit the top-level pom's plugins, b) define its own usage of the maven-compiler-plugin to a level that supports Java 17, or c) enforce a minimum Maven version of 3.9.0 (which bumps the default version of the compiler plugin to 3.11.0) instead of 3.8.6.

arjantijms commented 1 month ago

From the top of my head, the original reason it doesn't inhert from the regular top-level pom is the fact that it would put Arquillian multiple times on the classpath in some circumstances (since this module is included with every other module again). These circumstances were somewhat obscure.

Other TCK based multi-model maven projects do not avoid the parent though.

brideck commented 1 month ago

In my local testing, I've been able to make some progress by modifying the common pom to declare a parent, seemingly without any negative side effects. Is that the route we want to go? The TCK should certainly get an update of some sort for this, since it's currently unusable with certain test environment configurations.

arjantijms commented 1 month ago

Yes, let's update it. The original error was related to executing the tests from within the module folder vs from the root if I'm not mistaken.