Polish the SBDG Gradle Plugins.

* Rename MavenPublishingConventionsPlugin to MavenPublishConventionsPlugins.
* Rename SpringDependencyManagementConventionPlugin to SpringDependencyManagementConventionsPlugin.
* Refactor the application and configuration of the Spring DependencyManagementPlugin into a private method of the SpringDependencyManagementConventionsPlugin class.
* Reorder the Spring SNAPSHOT and MILESTONE Repository declarations in the SpringSampleBootPlugin.
This commit is contained in:
John Blum
2022-03-09 15:04:16 -08:00
parent 585ab03da6
commit 2f9d5dfcac
6 changed files with 12 additions and 11 deletions

View File

@@ -95,7 +95,7 @@ abstract class AbstractSpringJavaPlugin implements Plugin<Project> {
pluginManager.apply(PropDepsPlugin)
pluginManager.apply(PropDepsEclipsePlugin)
pluginManager.apply(PropDepsIdeaPlugin)
pluginManager.apply(SpringDependencyManagementConventionPlugin)
pluginManager.apply(SpringDependencyManagementConventionsPlugin)
pluginManager.apply(DependencySetPlugin)
pluginManager.apply(TestsConfigurationPlugin)
pluginManager.apply(IntegrationTestPlugin)

View File

@@ -18,7 +18,6 @@ package io.spring.gradle.convention
import io.spring.gradle.dependencymanagement.DependencyManagementPlugin
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.PluginManager
/**
* Applies and configures the Spring Gradle {@link DependencyManagementPlugin}.
@@ -32,24 +31,26 @@ import org.gradle.api.plugins.PluginManager
* @see org.gradle.api.Project
* @see org.gradle.api.plugins.PluginManager
*/
class SpringDependencyManagementConventionPlugin implements Plugin<Project> {
class SpringDependencyManagementConventionsPlugin implements Plugin<Project> {
static final String DEPENDENCY_MANAGEMENT_RESOURCE = "gradle/dependency-management.gradle"
@Override
void apply(Project project) {
PluginManager pluginManager = project.getPluginManager()
applyAndConfigureDependencyManagementPlugin(project)
applyDependencyManagementResources(project)
}
pluginManager.apply(DependencyManagementPlugin)
private void applyAndConfigureDependencyManagementPlugin(Project project) {
project.getPluginManager().apply(DependencyManagementPlugin)
project.dependencyManagement {
resolutionStrategy {
cacheChangingModulesFor 0, "seconds"
}
}
applyDependencyManagementResources(project)
}
@SuppressWarnings("all")

View File

@@ -31,8 +31,8 @@ class SpringSampleBootPlugin extends SpringSamplePlugin {
project.getPluginManager().apply("org.springframework.boot");
project.repositories {
maven { url 'https://repo.spring.io/snapshot' }
maven { url 'https://repo.spring.io/milestone' }
maven { url 'https://repo.spring.io/snapshot' }
}
}
}

View File

@@ -41,7 +41,7 @@ import org.gradle.api.publish.maven.plugins.MavenPublishPlugin;
* @see org.gradle.api.publish.maven.MavenPublication
* @see org.gradle.api.publish.maven.plugins.MavenPublishPlugin
*/
public class MavenPublishingConventionsPlugin implements Plugin<Project> {
public class MavenPublishConventionsPlugin implements Plugin<Project> {
@Override
public void apply(Project project) {

View File

@@ -38,7 +38,7 @@ public class SpringMavenPlugin implements Plugin<Project> {
PluginManager pluginManager = project.getPluginManager();
pluginManager.apply(MavenPublishPlugin.class);
pluginManager.apply(MavenPublishingConventionsPlugin.class);
pluginManager.apply(MavenPublishConventionsPlugin.class);
pluginManager.apply(PublishAllJavaComponentsPlugin.class);
pluginManager.apply(PublishArtifactsPlugin.class);
pluginManager.apply(PublishLocalPlugin.class);

View File

@@ -1 +1 @@
implementation-class=io.spring.gradle.convention.SpringDependencyManagementConventionPlugin
implementation-class=io.spring.gradle.convention.SpringDependencyManagementConventionsPlugin