grailsgradlegrails-3.1spring-boot-gradle-plugin

Grails 3 war -Inline plugin issues


I am trying to war the grails 3.1.9 application with inline plugin , its throwing an error saying "java.lang.IllegalStateException: Unable to rename 'C:\test\grails_demo\plugins\grails_demo_plugin\build\libs\grails_demo_plugin-0.1.jar' to 'C:\test\grails_demo\plugins\grails_demo_plugin\build\libs\grails_demo_plugin-0.1.jar.original'".

I am not sure why it cant rename the file. My settings.gradle file contains :

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

And in build.gradle file dependencies block contain as shown :

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"
}

when I tried to run the application , everything is working fine but when I did grails war , i am getting this error.

After few hours of google I found that, the error is from Gradle-Spring-Boot task bootRepackage .

As per this link(https://github.com/spring-projects/spring-boot/issues/1113) I just added "bootRepackage { classifier = 'exec' }" to my plugin's build.gradle file , the error went away but the plugin-jar is not added to the war file.

Here is the github link for my application(https://github.com/Vigneshwaran082/grails_demo)

Here is my complete stacktrace link (https://github.com/Vigneshwaran082/grails_demo/blob/Vigneshwaran082-stackTrace/stackTrace.txtenter link description here)


Solution

  • I am answering my own question , so that it might be useful for someone in future.

    Just disabling the bootRepackage task has fixed this issue .Just by adding "bootRepackage.enabled = false" to all build.gradle inside the plugins directory fixed this issue .