diff --git a/grails-shell/build.gradle b/grails-shell/build.gradle index 677e860398..9a603e9c05 100644 --- a/grails-shell/build.gradle +++ b/grails-shell/build.gradle @@ -31,9 +31,6 @@ dependencies { compileOnly libs.spring.web api libs.jansi api libs.jline - api libs.spring.boot.cli, { - exclude group: "org.codehaus.groovy", module: "groovy" - } dependenciesBom project(path: ":grails-bom", configuration: 'effectiveBom') implementation(libs.maven.resolver.provider) { exclude group: "com.google.guava", module: "guava" diff --git a/grails-shell/src/main/groovy/org/grails/cli/compiler/dependencies/DependencyManagementArtifactCoordinatesResolver.java b/grails-shell/src/main/groovy/org/grails/cli/compiler/dependencies/DependencyManagementArtifactCoordinatesResolver.java index 2375914227..ca5fb8214b 100644 --- a/grails-shell/src/main/groovy/org/grails/cli/compiler/dependencies/DependencyManagementArtifactCoordinatesResolver.java +++ b/grails-shell/src/main/groovy/org/grails/cli/compiler/dependencies/DependencyManagementArtifactCoordinatesResolver.java @@ -21,10 +21,11 @@ /** * {@link ArtifactCoordinatesResolver} backed by - * {@link SpringBootDependenciesDependencyManagement}. + * {@link GrailsDependenciesDependencyManagement}. * * @author Phillip Webb * @author Andy Wilkinson + * @author Michael Yan * @since 2022.1.0 */ public class DependencyManagementArtifactCoordinatesResolver implements ArtifactCoordinatesResolver { @@ -34,7 +35,7 @@ public class DependencyManagementArtifactCoordinatesResolver implements Artifact private final DependencyManagement dependencyManagement; public DependencyManagementArtifactCoordinatesResolver() { - this(new SpringBootDependenciesDependencyManagement()); + this(new GrailsDependenciesDependencyManagement()); } public DependencyManagementArtifactCoordinatesResolver(DependencyManagement dependencyManagement) { diff --git a/grails-shell/src/main/groovy/org/grails/cli/compiler/dependencies/SpringBootDependenciesDependencyManagement.java b/grails-shell/src/main/groovy/org/grails/cli/compiler/dependencies/SpringBootDependenciesDependencyManagement.java deleted file mode 100644 index 545e5cd190..0000000000 --- a/grails-shell/src/main/groovy/org/grails/cli/compiler/dependencies/SpringBootDependenciesDependencyManagement.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2012-2023 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.grails.cli.compiler.dependencies; - -import java.io.IOException; - -import org.apache.maven.model.Model; -import org.apache.maven.model.building.DefaultModelProcessor; -import org.apache.maven.model.io.DefaultModelReader; -import org.apache.maven.model.locator.DefaultModelLocator; - -/** - * {@link DependencyManagement} derived from the effective pom of - * {@code spring-boot-dependencies}. - * - * @author Andy Wilkinson - * @since 2022.1.0 - */ -public class SpringBootDependenciesDependencyManagement extends MavenModelDependencyManagement { - - public SpringBootDependenciesDependencyManagement() { - super(readModel()); - } - - private static Model readModel() { - DefaultModelProcessor modelProcessor = new DefaultModelProcessor(); - modelProcessor.setModelLocator(new DefaultModelLocator()); - modelProcessor.setModelReader(new DefaultModelReader()); - - try { - return modelProcessor.read(org.springframework.boot.cli.compiler.dependencies.SpringBootDependenciesDependencyManagement.class - .getResourceAsStream("spring-boot-dependencies-effective-bom.xml"), null); - } - catch (IOException ex) { - throw new IllegalStateException("Failed to build model from effective pom", ex); - } - } - -}