From 2d65bce18ee22e4eb5afde83b71033097f5bbf26 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 14 Sep 2021 21:58:22 +0200 Subject: [PATCH] Polish Eclipse IDE support --- gradle/ide.gradle | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gradle/ide.gradle b/gradle/ide.gradle index 913628b8e880..af4664e06018 100644 --- a/gradle/ide.gradle +++ b/gradle/ide.gradle @@ -19,16 +19,18 @@ eclipse.classpath.file.whenMerged { classpath -> def projectName = matcher[0][1] def path = "/${projectName}" if (!classpath.entries.find { e -> e instanceof ProjectDependency && e.path == path }) { + def recursiveDependency = entry.path.matches('.+/' + projectName + '/build/([^/]+/)+(?:main|test)') // Avoid recursive dependency on current project. - if (!entry.path.matches('.+/' + projectName + '/build/([^/]+/)+(?:main|test)')) { - def dependency = new ProjectDependency(path) - dependency.exported = true - classpath.entries.add(dependency) + if (!recursiveDependency) { + classpath.entries.add(new ProjectDependency(path)) } } classpath.entries.remove(entry) } } + + // Remove any remaining direct depencencies on JARs in the build/libs folder + // except Spring's spring-cglib-repack and spring-objenesis-repack JARs. classpath.entries.removeAll { entry -> (entry.path =~ /(?!.*?repack.*\.jar).*?\/([^\/]+)\/build\/libs\/[^\/]+\.jar/) } }