diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle index c002bc1aa61..53e073feae0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle @@ -1,3 +1,7 @@ +import org.gradle.plugins.ide.eclipse.EclipsePlugin +import org.gradle.plugins.ide.eclipse.model.Classpath +import org.gradle.plugins.ide.eclipse.model.Library + plugins { id "java-gradle-plugin" id "maven-publish" @@ -200,3 +204,19 @@ publishing { } } } + +plugins.withType(EclipsePlugin) { + eclipse { + classpath.file { merger -> + merger.whenMerged { content -> + if (content instanceof Classpath) { + content.entries.each { entry -> + if (entry instanceof Library && (entry.path.contains("gradle-api-") || entry.path.contains("groovy-"))) { + entry.entryAttributes.remove("test") + } + } + } + } + } + } +}