Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
brideck opened this issue Jul 18, 2024 · 4 comments
Open

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

brideck opened this issue Jul 18, 2024 · 4 comments

Comments

@brideck
Copy link
Contributor

brideck commented Jul 18, 2024

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
Copy link
Contributor

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
Copy link
Contributor Author

brideck commented Jul 30, 2024

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
Copy link
Contributor

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.

@brideck
Copy link
Contributor Author

brideck commented Sep 23, 2024

Dropped a PR for this issue as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants