我相信我已经解决了Web应用程序依赖性的问题。客户战争目前是一场失败的事业。
服务器内置gradle
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'application'
targetCompatibility = 1.8
sourceCompatibility = 1.8
version = '0.0.1-SNAPSHOT'
group = 'com.s2d'
mainClassName = 'com.simonsoftwaredesign.example.echo.server.EchoServerApp'
repositories {
mavenCentral()
}
configurations {
webContainer
}
dependencies {
compile project(':echo-core')
compile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.3.7.v20160115'
compile group: 'org.eclipse.jetty', name: 'jetty-webapp', version: '9.3.7.v20160115'
webContainer project(path: ':echo-admin', configuration: 'warApp')
}
task copyWebApps(dependsOn: configurations.webContainer, type: Copy) {
from { configurations.webContainer.collect { it } }
into 'src/main/dist/webapp'
}
installDist.dependsOn copyWebApps
distZip.dependsOn copyWebApps
distTar.dependsOn copyWebApps
Web应用程序构建.gradle
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'war'
targetCompatibility = 1.8
sourceCompatibility = 1.8
version = '0.0.1-SNAPSHOT'
group = 'com.s2d'
configurations {
warApp
}
repositories {
mavenCentral()
}
dependencies {
providedCompile project(':echo-core')
providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'
}
artifacts {
warApp war
}
Gradle projects depending on artifacts created by sibling projects