2012-02-15 77 views
0

我試圖使用私有的插件來構建一個Grails 2.0應用程序:Grails的2.0插件依賴性

  • myCompany中,前端= Grails應用程序
  • myCompany的核心= Grails插件的領域類

在mycompany-core插件中,我創建了一些域類,並在BuildConfig.groovy中添加了一個joda時間依賴項:

plugins { 
    build(":tomcat:$grailsVersion", 
      ":release:1.0.1", 
      ":svn:1.0.2") { 
     export = false 
    } 
    build(":joda-time:1.3.1") 
} 

在myCompany的-前端的應用程序,我有以下BuildConfig.groovy:

plugins { 
    runtime ":hibernate:$grailsVersion" 
    runtime ":resources:1.1.5" 
    build "mycompany:mycompany-core:0.1-SNAPSHOT" 

build ":svn:1.0.2" 
build ":spring-security-core:1.2.7" 
    build ":tomcat:$grailsVersion" 
} 

我還除去從application.properties grails.plugins條目以避免混淆。 但最後,mycompany-frontend無法從mycompany-core插件中找到模型類。

我應該看什麼/修復以使其正常工作?

回答

1

你是否嘗試過將依賴項定義爲你的核心插件作爲運行時/編譯依賴而不是構建?

+0

感謝您的回覆。我遵循這個建議http://www.nslms.com/2011/01/03/grails-plugin-dependencies/(如果我把每個依賴關係放在build + runtime + compile中看起來可行但不是一個好的解決方案)我是由於mycompany-core插件定義,期待mycompany-frontend應用程序自動導入joda-time – Wavyx 2012-02-16 08:51:46

+0

我轉移到「編譯」定義,並且一切正常。謝謝 – Wavyx 2012-02-16 09:27:25