diff --git a/buildSrc/src/main/groovy/io/spring/gradle/convention/RepositoryConventionPlugin.groovy b/buildSrc/src/main/groovy/io/spring/gradle/convention/RepositoryConventionPlugin.groovy index 407163d82a0..860c9bb642a 100644 --- a/buildSrc/src/main/groovy/io/spring/gradle/convention/RepositoryConventionPlugin.groovy +++ b/buildSrc/src/main/groovy/io/spring/gradle/convention/RepositoryConventionPlugin.groovy @@ -34,6 +34,14 @@ class RepositoryConventionPlugin implements Plugin { if (forceMavenRepositories?.contains('local')) { mavenLocal() } + maven { + name = 'shibboleth' + url = 'https://build.shibboleth.net/nexus/content/repositories/releases/' + content { + includeGroup('org.opensaml') + includeGroup('net.shibboleth.utilities') + } + } mavenCentral() if (isSnapshot) { maven { @@ -67,12 +75,11 @@ class RepositoryConventionPlugin implements Plugin { password project.artifactoryPassword } } + content { + excludeGroup('net.minidev') + } url = 'https://repo.spring.io/release/' } - maven { - name = 'shibboleth' - url = 'https://build.shibboleth.net/nexus/content/repositories/releases/' - } } } diff --git a/buildSrc/src/test/java/io/spring/gradle/convention/RepositoryConventionPluginTests.java b/buildSrc/src/test/java/io/spring/gradle/convention/RepositoryConventionPluginTests.java index f1048dbbab6..282bfe4f0ea 100644 --- a/buildSrc/src/test/java/io/spring/gradle/convention/RepositoryConventionPluginTests.java +++ b/buildSrc/src/test/java/io/spring/gradle/convention/RepositoryConventionPluginTests.java @@ -125,27 +125,27 @@ public void applyWhenIsReleaseWithForceMilestoneAndLocalThenShouldIncludeMilesto private void assertSnapshotRepository(RepositoryHandler repositories) { assertThat(repositories).extracting(ArtifactRepository::getName).hasSize(5); - 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/snapshot/"); + .isEqualTo("https://repo.maven.apache.org/maven2/"); 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(4); - assertThat(((MavenArtifactRepository) repositories.get(0)).getUrl().toString()) - .isEqualTo("https://repo.maven.apache.org/maven2/"); assertThat(((MavenArtifactRepository) repositories.get(1)).getUrl().toString()) + .isEqualTo("https://repo.maven.apache.org/maven2/"); + assertThat(((MavenArtifactRepository) repositories.get(2)).getUrl().toString()) .isEqualTo("https://repo.spring.io/milestone/"); } 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.maven.apache.org/maven2/"); + assertThat(((MavenArtifactRepository) repositories.get(2)).getUrl().toString()) .isEqualTo("https://repo.spring.io/release/"); } diff --git a/config/spring-security-config.gradle b/config/spring-security-config.gradle index 2ed2b813e55..2936c19376d 100644 --- a/config/spring-security-config.gradle +++ b/config/spring-security-config.gradle @@ -4,10 +4,6 @@ apply plugin: 'io.spring.convention.spring-module' apply plugin: 'trang' apply plugin: 'kotlin' -repositories { - maven { url "https://build.shibboleth.net/nexus/content/repositories/releases/" } -} - dependencies { management platform(project(":spring-security-dependencies")) // NB: Don't add other compile time dependencies to the config module as this breaks tooling diff --git a/docs/spring-security-docs.gradle b/docs/spring-security-docs.gradle index 4a6c15f1480..502f336bc05 100644 --- a/docs/spring-security-docs.gradle +++ b/docs/spring-security-docs.gradle @@ -1,6 +1,7 @@ plugins { id 'org.antora' version '1.0.0' id 'io.spring.antora.generate-antora-yml' version '0.0.1' + id 'io.spring.convention.repository' } apply plugin: 'io.spring.convention.docs' @@ -61,10 +62,3 @@ def resolvedVersions(Configuration configuration) { .resolvedArtifacts .collectEntries { [(it.name + '-version'): it.moduleVersion.id.version] } } - -repositories { - mavenCentral() - maven { url 'https://repo.spring.io/release' } - maven { url 'https://repo.spring.io/milestone' } - maven { url 'https://repo.spring.io/snapshot' } -}