From 5e4e530c59812c7d8d2b4d2ba292861dc9cecec5 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Wed, 7 Aug 2024 18:02:43 +0300 Subject: [PATCH] Remove Java 21 classpath entries in Eclipse projects Since the me.champeau.mrjar stores Java 21 main and test sources in non-standard locations, and since we can only use a single JDK within Eclipse, this commit updates `ide.gradle` to remove `java21` classpath entries in Eclipse projects. --- gradle/ide.gradle | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gradle/ide.gradle b/gradle/ide.gradle index 517e4af6c2..fbfa2c804b 100644 --- a/gradle/ide.gradle +++ b/gradle/ide.gradle @@ -69,6 +69,13 @@ eclipse.classpath.file.whenMerged { } } +// Remove Java 21 classpath entries, since we currently use Java 17 +// within Eclipse. Consequently, Java 21 features managed via the +// me.champeau.mrjar plugin cannot be built or tested within Eclipse. +eclipse.classpath.file.whenMerged { classpath -> + classpath.entries.removeAll { it.path =~ /src\/(main|test)\/java21/ } +} + // Remove classpath entries for non-existent libraries added by the me.champeau.mrjar // plugin, such as "spring-core/build/classes/kotlin/java21". eclipse.classpath.file.whenMerged {