我想用內聯插件來爭取grails 3.1.9應用程序,它拋出一個錯誤說「java.lang.IllegalStateException:無法重命名」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'「。Grails 3 war - 內聯插件問題
我不知道爲什麼它不能重命名文件。我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戰爭,我得到這個錯誤。
經過幾個小時的谷歌我發現,錯誤是從Gradle-Spring-Boot任務bootRepackage。
根據此鏈接(https://github.com/spring-projects/spring-boot/issues/1113),我只是將「bootRepackage {classifier ='exec'}」添加到我的插件的build.gradle文件中,錯誤消失了,但插件jar沒有添加到war文件中。
這裏是GitHub的鏈接,我的應用程序(https://github.com/Vigneshwaran082/grails_demo)
這裏是我的完整堆棧跟蹤鏈接(https://github.com/Vigneshwaran082/grails_demo/blob/Vigneshwaran082-stackTrace/stackTrace.txtenter link description here)