簡體   English   中英

Grails 3無法解析本地插件

[英]Grails 3 Cannot resolve local plugin

我正在開發插件,並在發布前在本地工作。 在工作完成之前,我想避免發布。

我已經閱讀了最新的Grails插件條目,但沒有解決我的問題,在這里也沒有解決一些類似的問題。

我的目錄結構是這樣的(與基於此SO鏈接的文檔略有不同):

    PROJECT_DIR
  - settings.gradle
  - myapp
    - build.gradle
    - settings.gradle
  - myplugin
    - build.gradle

在myApp build.gradle中:

  grails {
    plugins {
        compile project(':../myPlugin')
    }
  }

在myApp settings.gradle中(通過上面的鏈接):

include '../myPlugin'

project(':../myPlugin').projectDir = new File('../myPlugin')

這是構建失敗時出現的錯誤:

| Resolving Dependencies. Please wait...

...

:../proper-remote:compileWebappGroovyPages UP-TO-DATE
:../proper-remote:compileGroovyPages
:../proper-remote:jar FAILED

...

* What went wrong:
Execution failed for task ':../myPlugin:jar'.
> Could not create ZIP '/Users/me/projects/myPlugin/build/libs/../myPlugin.jar'.

...

Total time: 9.733 secs
| Error Gradle build terminated with error: /Users/me/projects/myPlugin/build/libs/../myPlugin.jar' (No such file or directory)

我的路徑不正確嗎? 我需要創建罐子嗎? 如果是這樣,我該怎么辦? 我已經嘗試過grails package-plugin無濟於事。

謝謝!

https://objectcomputing.com/products/grails/multi-project-builds/

通常,您不會像相對文件夾那樣引用依賴項

compile project(':myPlugin')

include 'myPlugin', 'myApp'

此外,您需要將所有信息從每個應用程序/插件的settings.gradle移到父文件夾中的“主”文件夾,並注釋掉/刪除每個應用程序/插件的setting.gradle文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM