Remove usages of Gradle's jcenter() repository

Closes gh-10253
This commit is contained in:
Lars Grefer 2021-11-20 02:22:13 +01:00 committed by Marcus Hert Da Coregio
parent 5c012dc7eb
commit 0541341201
3 changed files with 12 additions and 24 deletions

View File

@ -8,7 +8,6 @@ plugins {
sourceCompatibility = JavaVersion.VERSION_11 sourceCompatibility = JavaVersion.VERSION_11
repositories { repositories {
jcenter()
gradlePluginPortal() gradlePluginPortal()
mavenCentral() mavenCentral()
maven { url 'https://repo.spring.io/plugins-release/' } maven { url 'https://repo.spring.io/plugins-release/' }

View File

@ -35,11 +35,6 @@ class RepositoryConventionPlugin implements Plugin<Project> {
mavenLocal() mavenLocal()
} }
mavenCentral() mavenCentral()
jcenter() {
content {
includeGroup "org.gretty"
}
}
if (isSnapshot) { if (isSnapshot) {
maven { maven {
name = 'artifactory-snapshot' name = 'artifactory-snapshot'

View File

@ -107,7 +107,7 @@ public class RepositoryConventionPluginTests {
this.project.getPluginManager().apply(RepositoryConventionPlugin.class); this.project.getPluginManager().apply(RepositoryConventionPlugin.class);
RepositoryHandler repositories = this.project.getRepositories(); RepositoryHandler repositories = this.project.getRepositories();
assertThat(repositories).hasSize(5); assertThat(repositories).hasSize(4);
assertThat((repositories.get(0)).getName()).isEqualTo("MavenLocal"); assertThat((repositories.get(0)).getName()).isEqualTo("MavenLocal");
} }
@ -119,39 +119,33 @@ public class RepositoryConventionPluginTests {
this.project.getPluginManager().apply(RepositoryConventionPlugin.class); this.project.getPluginManager().apply(RepositoryConventionPlugin.class);
RepositoryHandler repositories = this.project.getRepositories(); RepositoryHandler repositories = this.project.getRepositories();
assertThat(repositories).hasSize(6); assertThat(repositories).hasSize(5);
assertThat((repositories.get(0)).getName()).isEqualTo("MavenLocal"); assertThat((repositories.get(0)).getName()).isEqualTo("MavenLocal");
} }
private void assertSnapshotRepository(RepositoryHandler repositories) { private void assertSnapshotRepository(RepositoryHandler repositories) {
assertThat(repositories).extracting(ArtifactRepository::getName).hasSize(6);
assertThat(((MavenArtifactRepository) repositories.get(0)).getUrl().toString())
.isEqualTo("https://repo.maven.apache.org/maven2/");
assertThat(((MavenArtifactRepository) repositories.get(1)).getUrl().toString())
.isEqualTo("https://jcenter.bintray.com/");
assertThat(((MavenArtifactRepository) repositories.get(2)).getUrl().toString())
.isEqualTo("https://repo.spring.io/snapshot/");
assertThat(((MavenArtifactRepository) repositories.get(3)).getUrl().toString())
.isEqualTo("https://repo.spring.io/milestone/");
}
private void assertMilestoneRepository(RepositoryHandler repositories) {
assertThat(repositories).extracting(ArtifactRepository::getName).hasSize(5); assertThat(repositories).extracting(ArtifactRepository::getName).hasSize(5);
assertThat(((MavenArtifactRepository) repositories.get(0)).getUrl().toString()) assertThat(((MavenArtifactRepository) repositories.get(0)).getUrl().toString())
.isEqualTo("https://repo.maven.apache.org/maven2/"); .isEqualTo("https://repo.maven.apache.org/maven2/");
assertThat(((MavenArtifactRepository) repositories.get(1)).getUrl().toString()) assertThat(((MavenArtifactRepository) repositories.get(1)).getUrl().toString())
.isEqualTo("https://jcenter.bintray.com/"); .isEqualTo("https://repo.spring.io/snapshot/");
assertThat(((MavenArtifactRepository) repositories.get(2)).getUrl().toString()) assertThat(((MavenArtifactRepository) repositories.get(2)).getUrl().toString())
.isEqualTo("https://repo.spring.io/milestone/"); .isEqualTo("https://repo.spring.io/milestone/");
} }
private void assertReleaseRepository(RepositoryHandler repositories) { private void assertMilestoneRepository(RepositoryHandler repositories) {
assertThat(repositories).extracting(ArtifactRepository::getName).hasSize(4); assertThat(repositories).extracting(ArtifactRepository::getName).hasSize(4);
assertThat(((MavenArtifactRepository) repositories.get(0)).getUrl().toString()) assertThat(((MavenArtifactRepository) repositories.get(0)).getUrl().toString())
.isEqualTo("https://repo.maven.apache.org/maven2/"); .isEqualTo("https://repo.maven.apache.org/maven2/");
assertThat(((MavenArtifactRepository) repositories.get(1)).getUrl().toString()) assertThat(((MavenArtifactRepository) repositories.get(1)).getUrl().toString())
.isEqualTo("https://jcenter.bintray.com/"); .isEqualTo("https://repo.spring.io/milestone/");
assertThat(((MavenArtifactRepository) repositories.get(2)).getUrl().toString()) }
private void assertReleaseRepository(RepositoryHandler repositories) {
assertThat(repositories).extracting(ArtifactRepository::getName).hasSize(3);
assertThat(((MavenArtifactRepository) repositories.get(0)).getUrl().toString())
.isEqualTo("https://repo.maven.apache.org/maven2/");
assertThat(((MavenArtifactRepository) repositories.get(1)).getUrl().toString())
.isEqualTo("https://repo.spring.io/release/"); .isEqualTo("https://repo.spring.io/release/");
} }