소스 검색

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
Eric Haag 1 년 전
부모
커밋
718c470910
1개의 변경된 파일10개의 추가작업 그리고 13개의 파일을 삭제
  1. 10 13
      config/spring-security-config.gradle

+ 10 - 13
config/spring-security-config.gradle

@@ -116,24 +116,21 @@ def versionlessXsd = project.tasks.create("versionlessXsd", CreateVersionlessXsd
 	versionlessXsdFile = project.layout.buildDirectory.file("versionlessXsd/spring-security.xsd")
 }
 
-processResources {
-	from(versionlessXsd) {
-		into 'org/springframework/security/config/'
-	}
-}
-
-tasks.named('rncToXsd', RncToXsd).configure {
+def rncToXsd = tasks.named('rncToXsd', RncToXsd)
+rncToXsd.configure {
 	rncDir = file('src/main/resources/org/springframework/security/config/')
 	xsdDir = rncDir
 	xslFile = new File(rncDir, 'spring-security.xsl')
 }
 
-sourceSets {
-	main {
-		resources {
-			srcDir(tasks.named('rncToXsd'))
-		}
-	}
+tasks.named('processResources', ProcessResources).configure {
+    from(versionlessXsd) {
+        into 'org/springframework/security/config/'
+    }
+    from(rncToXsd) {
+        duplicatesStrategy DuplicatesStrategy.EXCLUDE
+        into 'org/springframework/security/config/'
+    }
 }
 
 tasks.withType(KotlinCompile).configureEach {