mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-06 09:19:19 +00:00
Ensure eclipse classpath excludes binary output folders
Update `EclipseConventions` so that classpath `whenMerged` changes are applied via `JavaBasePlugin`. Without this change, the `whenMerged` item is added, but then`EclipsePlugin.configureEclipseClasspath` is called from a `project.getPlugins().withType(JavaBasePlugin.class, ...` call. Using a nested call appears to fix the issue, probably because it now runs after `configureEclipseClasspath`. Closes gh-46319
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package org.springframework.boot.build;
|
||||
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.plugins.JavaBasePlugin;
|
||||
import org.gradle.plugins.ide.api.XmlFileContentMerger;
|
||||
import org.gradle.plugins.ide.eclipse.EclipsePlugin;
|
||||
import org.gradle.plugins.ide.eclipse.model.Classpath;
|
||||
@@ -34,10 +35,12 @@ import org.gradle.plugins.ide.eclipse.model.Library;
|
||||
class EclipseConventions {
|
||||
|
||||
void apply(Project project) {
|
||||
project.getPlugins().withType(EclipsePlugin.class, (eclipse) -> {
|
||||
EclipseModel eclipseModel = project.getExtensions().getByType(EclipseModel.class);
|
||||
eclipseModel.classpath(this::configureClasspath);
|
||||
});
|
||||
project.getPlugins()
|
||||
.withType(EclipsePlugin.class,
|
||||
(eclipse) -> project.getPlugins().withType(JavaBasePlugin.class, (javaBase) -> {
|
||||
EclipseModel eclipseModel = project.getExtensions().getByType(EclipseModel.class);
|
||||
eclipseModel.classpath(this::configureClasspath);
|
||||
}));
|
||||
}
|
||||
|
||||
private void configureClasspath(EclipseClasspath classpath) {
|
||||
|
||||
Reference in New Issue
Block a user