【问题标题】:Grails 3 war -Inline plugin issuesGrails 3 war - 内联插件问题
【发布时间】:2016-08-17 10:13:15
【问题描述】:

我正在尝试使用内联插件来对抗 grails 3.1.9 应用程序,它抛出一个错误说“java.lang.IllegalStateException: Unable to rename 'C:\test\grails_demo\plugins\grails_demo_plugin\build\libs\grails_demo_plugin -0.1.jar' 到 'C:\test\grails_demo\plugins\grails_demo_plugin\build\libs\grails_demo_plugin-0.1.jar.original'”。

我不知道为什么它不能重命名文件。我的 settings.gradle 文件包含:

include 'grails_demo_plugin'
project(":grails_demo_plugin").projectDir =  new File("plugins/grails_demo_plugin")

并且在 build.gradle 文件中的依赖块包含如下所示:

dependencies {
    compile project(":grails_demo_plugin")
    compile "org.springframework.boot:spring-boot-starter-logging"
    compile "org.springframework.boot:spring-boot-autoconfigure"
    compile "org.grails:grails-core"
    compile "org.springframework.boot:spring-boot-starter-actuator"
    compile "org.springframework.boot:spring-boot-starter-tomcat"
    compile "org.grails:grails-dependencies"
    compile "org.grails:grails-web-boot"
    compile "org.grails.plugins:cache"
    compile "org.grails.plugins:scaffolding"
    compile "org.grails.plugins:hibernate4"
    compile "org.hibernate:hibernate-ehcache"
    console "org.grails:grails-console"
    profile "org.grails.profiles:web"
    runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.8.2"
    runtime "com.h2database:h2"
    testCompile "org.grails:grails-plugin-testing"
    testCompile "org.grails.plugins:geb"
    testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
    testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
}

当我尝试运行应用程序时,一切正常,但是当我执行 grails war 时,我收到了这个错误。

经过几个小时的谷歌我发现,错误来自 Gradle-Spring-Boot 任务 bootRepackage 。

根据此链接(https://github.com/spring-projects/spring-boot/issues/1113),我刚刚在插件的 build.gradle 文件中添加了“bootRepackage { classifier = 'exec' }”,错误消失了,但 plugin-jar 未添加到 war 文件中。

这是我的应用程序的 github 链接(https://github.com/Vigneshwaran082/grails_demo)

这是我的完整堆栈跟踪链接 (https://github.com/Vigneshwaran082/grails_demo/blob/Vigneshwaran082-stackTrace/stackTrace.txtenter link description here)

【问题讨论】:

    标签: grails gradle grails-3.1 spring-boot-gradle-plugin


    【解决方案1】:

    我正在回答我自己的问题,以便将来对某人有用。

    只需禁用 bootRepackage 任务即可解决此问题。只需将“bootRepackage.enabled = false”添加到插件目录中的所有 build.gradle 即可解决此问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-04
      • 1970-01-01
      • 1970-01-01
      • 2011-06-16
      • 2015-08-17
      • 2011-05-23
      • 2014-08-30
      • 2016-06-28
      相关资源
      最近更新 更多