Skip to content

Commit 45b93dc

Browse files
committed
Do not use snapshot repository for dependencyUpdates task
Closes gh-1637
1 parent f578683 commit 45b93dc

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

gradle/plugins/conventions-plugin/src/main/java/org/springframework/ws/gradle/conventions/JavaBasePluginConventions.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
*/
3030
class JavaBasePluginConventions {
3131

32+
static final String SPRING_MILESTONE_REPOSITORY_NAME = "Spring Milestones";
33+
34+
static final String SPRING_SNAPSHOT_REPOSITORY_NAME = "Spring Snapshots";
35+
3236
void apply(Project project) {
3337
configureRepositories(project);
3438
project.getTasks().withType(Javadoc.class).configureEach((javadoc) -> {
@@ -46,13 +50,13 @@ private void configureRepositories(Project project) {
4650
String version = project.getVersion().toString();
4751
if (version.contains("-")) {
4852
project.getRepositories().maven((repository) -> {
49-
repository.setName("Spring Milestones");
53+
repository.setName(SPRING_MILESTONE_REPOSITORY_NAME);
5054
repository.setUrl("https://repo.spring.io/milestone");
5155
});
5256
}
5357
if (version.endsWith("-SNAPSHOT")) {
5458
project.getRepositories().maven((repository) -> {
55-
repository.setName("Spring Snapshots");
59+
repository.setName(SPRING_SNAPSHOT_REPOSITORY_NAME);
5660
repository.setUrl("https://repo.spring.io/snapshot");
5761
});
5862
}

gradle/plugins/conventions-plugin/src/main/java/org/springframework/ws/gradle/conventions/VersionUpgradePluginConventions.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ class VersionUpgradePluginConventions {
3535
void apply(Project project) {
3636
project.getPlugins().apply(VersionsPlugin.class);
3737
project.getTasks().withType(DependencyUpdatesTask.class, (updateTask) -> {
38+
updateTask.doFirst((task) -> project.getRepositories()
39+
.removeIf((candidate) -> candidate.getName()
40+
.equals(JavaBasePluginConventions.SPRING_SNAPSHOT_REPOSITORY_NAME)));
3841
updateTask.setFilterConfigurations((configuration) -> !(configuration.getName().contains("_")
3942
&& configuration.getName().endsWith("+")));
4043
VersionUpgradePolicy upgradePolicy = getUpgradePolicy(project);

0 commit comments

Comments
 (0)