From c385a59b68466d59a813f3d2f7744f30474abf5b Mon Sep 17 00:00:00 2001 From: Rob Winch <362503+rwinch@users.noreply.github.com> Date: Thu, 24 Apr 2025 19:49:20 -0500 Subject: [PATCH] Improve SchemaZipPlugin Error Message Signed-off-by: Rob Winch <362503+rwinch@users.noreply.github.com> --- .../io/spring/gradle/convention/SchemaZipPlugin.groovy | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/groovy/io/spring/gradle/convention/SchemaZipPlugin.groovy b/buildSrc/src/main/groovy/io/spring/gradle/convention/SchemaZipPlugin.groovy index 3fccb2aef8..cb1fb3b8a4 100644 --- a/buildSrc/src/main/groovy/io/spring/gradle/convention/SchemaZipPlugin.groovy +++ b/buildSrc/src/main/groovy/io/spring/gradle/convention/SchemaZipPlugin.groovy @@ -32,10 +32,13 @@ public class SchemaZipPlugin implements Plugin { for (def key : schemas.keySet()) { def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1') assert shortName != key + def schemaResourceName = schemas.get(key) File xsdFile = module.sourceSets.main.resources.find { - it.path.endsWith(schemas.get(key)) + it.path.endsWith(schemaResourceName) + } + if (xsdFile == null) { + throw new IllegalStateException("Could not find schema file for resource name " + schemaResourceName + " in src/main/resources") } - assert xsdFile != null schemaZip.into (shortName) { duplicatesStrategy 'exclude' from xsdFile.path