Skip to content

Commit 718c470

Browse files
erichaagdevmarcusdacoregio
authored andcommitted
Prevent creating duplicate .xsd entries
This change removes .xsd entries that would appear in the top level of the assembled artifacts. This occurred because the output of the rncToXsd task does not consider the path beneath the resources directory. To fix this, the processResources task is directly configured with a copy spec so the required path can be set. Issue gh-13845
1 parent 700b711 commit 718c470

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

config/spring-security-config.gradle

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,24 +116,21 @@ def versionlessXsd = project.tasks.create("versionlessXsd", CreateVersionlessXsd
116116
versionlessXsdFile = project.layout.buildDirectory.file("versionlessXsd/spring-security.xsd")
117117
}
118118

119-
processResources {
120-
from(versionlessXsd) {
121-
into 'org/springframework/security/config/'
122-
}
123-
}
124-
125-
tasks.named('rncToXsd', RncToXsd).configure {
119+
def rncToXsd = tasks.named('rncToXsd', RncToXsd)
120+
rncToXsd.configure {
126121
rncDir = file('src/main/resources/org/springframework/security/config/')
127122
xsdDir = rncDir
128123
xslFile = new File(rncDir, 'spring-security.xsl')
129124
}
130125

131-
sourceSets {
132-
main {
133-
resources {
134-
srcDir(tasks.named('rncToXsd'))
135-
}
136-
}
126+
tasks.named('processResources', ProcessResources).configure {
127+
from(versionlessXsd) {
128+
into 'org/springframework/security/config/'
129+
}
130+
from(rncToXsd) {
131+
duplicatesStrategy DuplicatesStrategy.EXCLUDE
132+
into 'org/springframework/security/config/'
133+
}
137134
}
138135

139136
tasks.withType(KotlinCompile).configureEach {

0 commit comments

Comments
 (0)