Maven에서 Gradle로 마이그레이션하는 중입니다. 불행히도 우리는 여전히 몇 가지 전쟁 오버레이를 처리해야합니다.하나의 Zip 파일을 다른 Gradle에 복사
임시 해결책으로 한 전쟁 파일의 내용을 다른 것으로 복사하려고합니다.
task overlayWars (dependsOn: war) << {
// Get the source war files to copy the contents from...
def dependencyWars = configurations.runtime.filter { it.name.endsWith ('.war') }
dependencyWars.each { dependentWar ->
// Get the products, ie the target war file...
war.outputs.files.each { product ->
println "Copying $dependentWar contents into $product"
copy {
from { zipTree (dependentWar) }
into { zipTree (product)} // this seems to be the problem
include 'WEB-INF/classes/**/*.class'
include 'WEB-INF/jsp/**/*.jsp'
}
}
}
}
into { zipTree (product)}
파일입니다 (같은 file ('tmp/whatever')
가)이 잘 작동 :
이것은 내가 지금까지있는 것입니다. (대상 war 파일) 다른 zip 파일을 지정하는 경우이 오류와 함께 실패합니다
Converting class org.gradle.api.internal.file.collections.FileTreeAdapter to File using toString() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use java.io.File, java.lang.String, java.net.URL, or java.net.URI instead.
사람이 특히, 또는 더 좋은 방법을 "오버레이"전쟁 파일에 대한 제안이 있다면, 나는 그것을 정말 감사하겠습니다!
의견을 보내 주셔서 감사합니다 - 틀림없이 정확합니다. BTW, 어떻게 파일 시스템에서 .war로부터 "existingWar"를 만들겠습니까? 나는 새로운 것을 만드는 법을 보았지만, 기존의 것을 참조하거나로드하는 방법을 알지 못했습니다 ... – node42
할 수 없습니다. 'Zip' 태스크를 생성하고 Wars를 병합합니다. –
이 작업을 수행하는 방법에 대한 전체 예제를 제공해 주시겠습니까? – opticyclic