Java: Add test for multi-module projects with different Java versions#20615
Merged
Java: Add test for multi-module projects with different Java versions#20615
Conversation
319cd47 to
2840662
Compare
e1e38c2 to
2840662
Compare
f708313 to
074c726
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces new integration tests for Maven-based Java projects that verify the handling of different Java version configurations and compilation scenarios. The tests ensure that CodeQL's database creation works correctly across various Java version setups.
Key changes:
- Added four new Maven integration test projects to validate Java version handling
- Created test cases for multimodule projects with different Java versions per module, module flags (--add-exports), execution-specific Java versions, and Java 8 projects with Java 11+ dependencies
Reviewed Changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| maven-multimodule-test-java-version/* | Tests a Maven multimodule project where parent uses Java 17 and test-module uses Java 21 with pattern matching features |
| maven-java8-java11-dependency/* | Tests a Java 8 project that depends on TestNG 7.7.0, which requires Java 11+ |
| maven-java16-with-higher-jdk/* | Tests a Java 16 project using records that should compile when only Java 17+ is available |
| maven-execution-specific-java-version/* | Tests a project with different Java versions per execution (Java 11 for main, Java 17 for test code) |
| maven-add-exports-module-flags/* | Tests a project using --add-exports flags to access JDK compiler internals |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import java.util.List; | ||
|
|
||
| /** | ||
| * Simple class using Java 16 features (e.g.,records). |
There was a problem hiding this comment.
Missing space after comma in 'e.g.,records'. Should be 'e.g., records' with a space after the comma.
Suggested change
| * Simple class using Java 16 features (e.g.,records). | |
| * Simple class using Java 16 features (e.g., records). |
smowton
previously approved these changes
Nov 11, 2025
074c726 to
40210cf
Compare
055af99 to
3b7f2f4
Compare
Contributor
Author
|
@smowton I added a change note as you suggested. Would you be able to review it? |
smowton
previously approved these changes
Nov 13, 2025
Co-authored-by: Chris Smowton <smowton@github.com>
esteffin
approved these changes
Nov 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds 5 new integration tests:
--add-exportsmodule flag detection