Disable reloading in Grails 3.1 / springloaded

前端 未结 3 879
余生分开走
余生分开走 2021-01-12 12:17

I\'m trying to disable automatic reload/recompiling in Grails 3.1 as I would like to use JRebel instead. I find springloaded rather limited, but more importantly is constant

3条回答
  •  春和景丽
    2021-01-12 12:35

    Burt's answer is correct related to the question -> how to disable autoreloading.

    However, Anton's answer is relevant to the second/related issue on getting Jrebel to work.

    I now have a working example, which works with both

    gradle bootRun -Pjrebel   -> disable springloaded, using jrebel
    gradle bootRun            -> uses springloaded
    

    and

    grails
    grails> run-app
    

    My config is a combination of

    export GRAILS_OPTS="-javaagent:$JREBEL_HOME/jrebel.jar -Drebel.base=/Users//.jrebel"
    

    and build.gradle

    rebel {
      alwaysGenerate = false
      showGenerated = true
    //rebelXmlDirectory = "build/classes"
    }
    
    if (project.hasProperty('jrebel')) {
      bootRun.dependsOn(generateRebel)
      grails {
        agent {
          enabled = false
        }
      } 
      tasks.withType(JavaExec) {
        jvmArgs "-javaagent:jrebel.jar"
        jvmArgs "-Xverify:none"
      }
    }
    

    Thanks @burt-beckwith and @anton-arhipov for your input!

提交回复
热议问题