0
我们正在尝试设置多项目构建。Gradle - 多项目编译但未找到共享项目类
我们有2个项目:
1)PlayerManager 2)共享
我们的项目编译,当我们运行gradle.test任务
问题是,当我们试图测试成功在eclipse中运行tomcat上的项目,我们得到了共享项目中所有文件的class not found错误。
这里是我们的gradle.build文件:
PlayerManager(根)
=======================
apply plugin: 'war'
apply plugin: 'jetty'
apply plugin: 'eclipse-wtp'
apply plugin: 'eclipse'
apply from: 'dependencies.gradle'
apply from: 'xmlHandler.gradle'
apply plugin: 'base'
dependsOn(":NGShared:NGShared")
task wrapper(type: Wrapper) {
gradleVersion = '1.9'
}
repositories {
mavenCentral()
}
dependencies {
providedCompile 'javax.servlet:servlet-api:2.5'
compile 'org.springframework:spring-webmvc:3.2.2.RELEASE'
runtime 'javax.servlet:jstl:1.1.2'
}
/* Change context path (base url). otherwise defaults to name of project */
jettyRunWar.contextPath = ''
task cleanAndBuild(dependsOn: ['clean', 'assemble'])
assemble.mustRunAfter clean
tasks.withType(Test) {
testLogging {
events 'passed'
}
}
task testSanity(type: Test, dependsOn: testClasses) {
exclude '*/TimeBaseTest*'
}
共享(子项目)
=======================
apply plugin: 'java'
apply plugin: 'eclipse'
apply from: 'dependencies.gradle'
task wrapper(type: Wrapper) {
gradleVersion = '1.9'
}
settings.gradle
include ":NGShared:NGShared"
======================================================
Our path for the project is:
/NGPlayerManager/
/NGPlayerManager/NGShared/NGShared
任何想法为什么?
感谢
是的,没有工作 – Urbanleg
我想我明白了!修改'dependsOn(“:NGShared:NGShared”)' '依赖关系{/ *其余依赖关系... */ compile project(':NGShared:NGShared') } –