Сделал мультимодульный проект, web - собирается в war, dist должен собирать zip с томкатом и этим варом в webapps, в итоге вместо варника он копирует туда зависимости модуля. Как это можно пофиксить ?
dist:
apply plugin: 'java'
group 'com.example.server'
version '1.0-SNAPSHOT'
ext {
tomcatVersion = '8.0.26'
}
configurations {
tomcatDist
tomcatWeb
tomcatDependency
}
dependencies {
tomcatDist "org.apache.tomcat:tomcat:${tomcatVersion}@zip"
tomcatDependency "org.glassfish:javax.faces:2.1.7-06";
tomcatWeb project(":web");
}
task tomcatDistCopy(type: Copy) {
configurations.tomcatDist.findAll { distFile ->
from zipTree(distFile)
}
into "$buildDir/dev/tomcat"
[ 'bin', 'conf', 'lib' ].each { subDir ->
include "apache-tomcat-${tomcatVersion}/${subDir}/**"
}
eachFile { details ->
details.path = details.path.replaceAll('([^/]+)/(.*)', { "${it[2]}" })
}
includeEmptyDirs = false
}
task tomcatDependencyCopy(type: Copy, dependsOn: tomcatDistCopy) {
configurations.tomcatDependency.findAll { dependency ->
from dependency
}
into "$buildDir/dev/tomcat/lib/common"
}
task webDependencyCopy(type: Copy, dependsOn: tomcatDistCopy) {
from configurations.tomcatWeb
into "$buildDir/dev/tomcat/webapps"
}
task tomcatAssemble(type: Copy ) {
}
tomcatAssemble.dependsOn tomcatDependencyCopy, webDependencyCopy
build.dependsOn(dist)
web:
apply plugin: 'java'
apply plugin: 'war'
group 'com.example.server'
version '1.0-SNAPSHOT'
dependencies {
compile "org.glassfish:javax.faces:2.1.7-06"
compile "org.apache.tomcat:tomcat-servlet-api:8.0.26"
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
}
}
war {
from 'src/main/webapp'
webXml = file('src/main/web.xml')
}