Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.example</groupId>
<artifactId>maven-multimodule-test-java-version</artifactId>
<version>1.0</version>
</parent>
<artifactId>main-module</artifactId>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.example;

public class App {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>maven-multimodule-test-java-version</artifactId>
<version>1.0</version>
<packaging>pom</packaging>

<properties>
<maven.compiler.release>17</maven.compiler.release>
</properties>

<modules>
<module>main-module</module>
<module>test-module</module>
</modules>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
main-module/pom.xml
main-module/src/main/java/com/example/App.java
main-module/target/maven-archiver/pom.properties
pom.xml
test-module/pom.xml
test-module/src/main/java/com/example/tests/TestUtils.java
test-module/target/maven-archiver/pom.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.example</groupId>
<artifactId>maven-multimodule-test-java-version</artifactId>
<version>1.0</version>
</parent>
<artifactId>test-module</artifactId>

<properties>
<maven.compiler.release>21</maven.compiler.release>
</properties>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.example.tests;

// Requires Java 21: switch with pattern matching and guards
public class TestUtils {
public static String analyze(Object obj) {
return switch (obj) {
case String s when s.length() > 5 -> "long";
case String s -> "short";
default -> "other";
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test(codeql, java):
codeql.database.create()