From 26566af43180a9567f39e21980bbc2bd710af054 Mon Sep 17 00:00:00 2001 From: Steve Riesenberg Date: Tue, 28 Feb 2023 16:16:08 -0600 Subject: [PATCH] Copy spring-security-oauth schemas on deploy Closes gh-12804 --- .../convention/SchemaDeployPlugin.groovy | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/buildSrc/src/main/groovy/io/spring/gradle/convention/SchemaDeployPlugin.groovy b/buildSrc/src/main/groovy/io/spring/gradle/convention/SchemaDeployPlugin.groovy index 4b9c038dbb1..8ad676753f5 100644 --- a/buildSrc/src/main/groovy/io/spring/gradle/convention/SchemaDeployPlugin.groovy +++ b/buildSrc/src/main/groovy/io/spring/gradle/convention/SchemaDeployPlugin.groovy @@ -62,6 +62,33 @@ public class SchemaDeployPlugin implements Plugin { execute "rm -f $tempPath*.zip" execute "rm -rf $extractPath*" execute "mv $tempPath/* $extractPath" + + /* + * Copy spring-security-oauth schemas so that legacy projects using the "http" scheme can + * resolve the following schema locations: + * + * - http://www.springframework.org/schema/security/spring-security-oauth-1.0.xsd + * - http://www.springframework.org/schema/security/spring-security-oauth2-1.0.xsd + * - http://www.springframework.org/schema/security/spring-security-oauth2-2.0.xsd + * + * Note: The directory: + * https://www.springframework.org/schema/security/ + * + * is a symbolic link pointing to: + * https://docs.spring.io/autorepo/schema/spring-security/current/security/ + * + * which in turn points to the latest: + * https://docs.spring.io/autorepo/schema/spring-security/$version/security/ + * + * with the help of the autoln command which is run regularly via a cron job. + * + * See https://github.com/spring-io/autoln for more info. + */ + if (name == "spring-security") { + def springSecurityOauthPath = "/var/www/domains/spring.io/docs/htdocs/autorepo/schema/spring-security-oauth/current/security" + execute "cp $springSecurityOauthPath/* $extractPath" + } + execute "chmod -R g+w $extractPath" } }