我正在尝试创建一个类似于此结构的 Gradle 多项目
ouat-services
- ouat-contract
- ouat-servicesImpl (web project)
我遵循了 eclipse 示例并将我的 ouat-services settings.gradle 定义为
include "ouat-contract", "ouat-servicesImpl"
在我的 ouat-servicesImpl build-gradle 我定义
dependencies {
compile project(':ouat-contract')
}
当我尝试在 ouat-servicesImpl 中应用 war 插件时,我的问题就开始了,我在 eclipse 问题视图中收到以下消息:
Invalid classpath publish/ export dependency /ouat-contract. Project entries not supported
我的 ouat 服务 build.gradle
configure(subprojects) {
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'eclipse'
apply plugin: 'java'
version = '1.0'
sourceCompatibility = 1.8
targetCompatibility = 1.8
def defaultEncoding = 'UTF-8'
[compileJava, compileTestJava]*.options*.encoding = defaultEncoding
repositories {
jcenter()
mavenLocal()
mavenCentral()
}
jar {
manifest.attributes provider: 'Company'
}
}
configure(project(':ouat-servicesImpl')) {
apply plugin: 'checkstyle'
apply plugin: 'eclipse-wtp'
apply plugin: 'findbugs'
apply plugin: 'jacoco'
//apply plugin: 'jetty'
apply plugin: 'pmd'
apply plugin: 'war'
}
buildscript {
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
dependencies {
classpath 'com.github.ben-manes:gradle-versions-plugin:0.10.1'
}
}
我的 ouat-servicesImpl 构建 gradle 更改为:
dependencies {
compile project(':ouat-contract')
cxfArtifacts.each { artifact ->
compile "org.apache.cxf:$artifact:$cxfVersion"
}
springArtifacts.each { artifact ->
compile "org.springframework:$artifact:$springVersion"
}
testCompile "org.testng:testng:$testNGVersion"
testCompile "org.hamcrest:hamcrest-all:$hamcrestVersion"
testCompile "org.springframework:spring-test:$springVersion"
//WAR PLUGIN
providedCompile "javax.servlet:javax.servlet-api:$servletAPIVersion"
runtime "javax.servlet:jstl:$jstlVersion"
}
这是eclipse插件问题还是我做错了什么?