mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-05-31 17:22:13 +00:00
Improve SchemaZipPlugin Error Message
Signed-off-by: Rob Winch <362503+rwinch@users.noreply.github.com>
This commit is contained in:
parent
184cd96ee6
commit
c385a59b68
@ -32,10 +32,13 @@ public class SchemaZipPlugin implements Plugin<Project> {
|
|||||||
for (def key : schemas.keySet()) {
|
for (def key : schemas.keySet()) {
|
||||||
def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
|
def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
|
||||||
assert shortName != key
|
assert shortName != key
|
||||||
|
def schemaResourceName = schemas.get(key)
|
||||||
File xsdFile = module.sourceSets.main.resources.find {
|
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) {
|
schemaZip.into (shortName) {
|
||||||
duplicatesStrategy 'exclude'
|
duplicatesStrategy 'exclude'
|
||||||
from xsdFile.path
|
from xsdFile.path
|
||||||
|
Loading…
x
Reference in New Issue
Block a user