我想创建一个类似于这种结构的摇篮多项目无效的类路径publish/export dependency/ouat-contract。项目条目不支持
ouat-services
- ouat-contract
- ouat-servicesImpl (web project)
我跟着日食例子和定义我ouat服务settings.gradle为
include "ouat-contract", "ouat-servicesImpl"
在我ouat -servicesImpl集结gradle这个我定义
dependencies {
compile project(':ouat-contract')
}
当我尝试运用战争插件在ouat-servicesImpl,I R我的问题开始在Eclipse问题视图eceive以下消息:
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插件问题还是我做错了什么?
所以你说的这实际上不适用于eclipse项目。解决方案是每次更新eclipse文件时手动添加项目作为依赖关系。对? – ATrubka