2017-05-25 107 views
0

幾個月來,我們一直在使用Buildship 1.X以及一些手動啓動/任務來構建每個開發環境的Eclipse/WTP配置文件。我目前正試圖遷移到使用Buildship 2(我希望將擺脫手動位的需求)。Buildship 2子項目不鏈接爲項目依賴關係

但是,當我導入項目(此時有0個eclipse配置文件)通過構建/ gradle導入,子項目通過'庫'而不是'項目'(參見下圖)。相反,如果我使用gradle的eclipse任務來生成eclipse配置文件(即.classpath),那麼配置結果如我所料。這是Buildship的當前侷限性,還是我需要在我的Gradle文件中採用不同的方式強制Buildship將它們作爲項目引入?

最終我不知道我應該關心這種差異,但我確實知道我收到編譯器錯誤,指出來自子項目的類從類路徑中丟失。只要我能解決這個問題,我就非常開心。

opposite of what I expected to see

潛在有用的信息

settings.gradle:

rootProject.name = 'projectroot' 

include 'Project2.0' 
project(':Project2.0').name = 'projectx' 
include 'the-platform' 
include 'the-platform:central-repo:central-repo-common' 
include 'the-platform:central-repo:central-repo-model' 
include 'the-platform:central-repo:central-repo-persist' 
include 'the-platform:central-repo:central-repo-service' 

Project2.0 /的build.gradle(片段):

dependencies { 
    ... 
    compile project(':the-platform:central-repo:central-repo-common') 
    compile project(':the-platform:central-repo:central-repo-model') 
    compile project(':the-platform:central-repo:central-repo-persist') 
    compile project(':the-platform:central-repo:central-repo-service') 
    ... 
} 

回答

0

嗯,沒關係。我對構建的行爲與eclipse插件對gradle負責解決我的類路徑問題的區別的直覺是錯誤的。還有其他的東西(至今還沒有解釋)一定是這個問題,因爲它現在正在正確地工作。