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') } –