Skip to content

Commit c385a59

Browse files
committed
Improve SchemaZipPlugin Error Message
Signed-off-by: Rob Winch <[email protected]>
1 parent 184cd96 commit c385a59

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

buildSrc/src/main/groovy/io/spring/gradle/convention/SchemaZipPlugin.groovy

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@ public class SchemaZipPlugin implements Plugin<Project> {
3232
for (def key : schemas.keySet()) {
3333
def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
3434
assert shortName != key
35+
def schemaResourceName = schemas.get(key)
3536
File xsdFile = module.sourceSets.main.resources.find {
36-
it.path.endsWith(schemas.get(key))
37+
it.path.endsWith(schemaResourceName)
38+
}
39+
if (xsdFile == null) {
40+
throw new IllegalStateException("Could not find schema file for resource name " + schemaResourceName + " in src/main/resources")
3741
}
38-
assert xsdFile != null
3942
schemaZip.into (shortName) {
4043
duplicatesStrategy 'exclude'
4144
from xsdFile.path

0 commit comments

Comments
 (0)