Skip to content

Commit f2e5e5a

Browse files
committed
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
1 parent b6083c7 commit f2e5e5a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

gradle/ide.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ eclipse.classpath.file.whenMerged { classpath ->
4747
}
4848
}
4949

50+
// Ensure project dependencies come after 3rd-party libs (SPR-11836)
51+
// https://jira.spring.io/browse/SPR-11836
52+
eclipse.classpath.file.whenMerged { classpath ->
53+
classpath.entries.findAll { it instanceof ProjectDependency }.each {
54+
// delete from original position
55+
classpath.entries.remove(it)
56+
// append to end of classpath
57+
classpath.entries.add(it)
58+
}
59+
}
60+
5061
// Allow projects to be used as WPT modules
5162
eclipse.project.natures "org.eclipse.wst.common.project.facet.core.nature"
5263

0 commit comments

Comments
 (0)