From f2e5e5aa86d827f14754f77666a76da89cfbf8d0 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 24 Apr 2015 21:39:57 +0200 Subject: [PATCH] Eclipse project deps come after third-party libs This commit is a backport of SPR-11836. Prior to this commit, the ordering of classpath entries in the generated Eclipse .classpath files did not align with the intended dependency management configured in the Gradle build. Specifically, project dependencies often came before dependencies on third-party libraries required for the given project, causing the project not to compile in Eclipse. This commit fixes this issue by introducing new functionality in the ide.gradle script that moves all project dependencies to the end of the generated classpath. Issue: SPR-12947, SPR-11836 --- gradle/ide.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gradle/ide.gradle b/gradle/ide.gradle index ef2b871618f..482a8f9307b 100644 --- a/gradle/ide.gradle +++ b/gradle/ide.gradle @@ -47,6 +47,17 @@ eclipse.classpath.file.whenMerged { classpath -> } } +// Ensure project dependencies come after 3rd-party libs (SPR-11836) +// https://jira.spring.io/browse/SPR-11836 +eclipse.classpath.file.whenMerged { classpath -> + classpath.entries.findAll { it instanceof ProjectDependency }.each { + // delete from original position + classpath.entries.remove(it) + // append to end of classpath + classpath.entries.add(it) + } +} + // Allow projects to be used as WPT modules eclipse.project.natures "org.eclipse.wst.common.project.facet.core.nature"