Disable reloading in Grails 3.1 / springloaded

前端 未结 3 858
余生分开走
余生分开走 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/<username>/.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!

    0 讨论(0)
  • 2021-01-12 12:46

    In 3.x apps you can disable Spring Loaded by adding

    grails {
       agent {
          enabled = false
       }
    }
    

    to build.gradle.

    0 讨论(0)
  • 2021-01-12 12:49

    To enable JRebel for Grails 3 project you need to configure -javaagent argument with the corresponding path the jrebel.jar in build.gradle file:

    tasks.withType(JavaExec) { jvmArgs "-javaagent:jrebel.jar" }
    
    0 讨论(0)
提交回复
热议问题