When i use springloaded in my project. There is a similar question in Spring Boot + Spring-Loaded (IntelliJ, Gradle) According to the document , my build.gradle is :
buildscript{
ext{
springBootVersion = '1.3.5.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath 'org.springframework:springloaded:1.2.0.RELEASE'
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
//apply plugin: 'application'
springBoot {
backupSource = false
mainClass = 'com.zhb.app.PortalApplication'
}
jar {
baseName = 'springBootTest'
version = '0.0.1-SNAPSHOT'
}
//applicationDefaultJvmArgs = ['-javaagent:E:\\xgsdk\\commonLib\\springloaded-1.2.5.RELEASE.jar -noverify']
repositories {
mavenCentral()
}
dependencies {
compile "org.springframework.boot:spring-boot-starter-web",
"com.alibaba:fastjson:1.2.4",
"commons-codec:commons-codec:1.5",
"org.apache.commons:commons-lang3:3.3.2"
testCompile("org.springframework.boot:spring-boot-starter-test")
}
when i run the application in eclipse. the springloaded is not working.
then i follow the springloaded document, add -javaagent:<pathTo>/springloaded-{VERSION}.jar -noverify
to the run configuration
Finally it is working well.
There are two question arise in my mind.
the first is the springloaded dependency classpath'org.springframework:springloaded:1.2.0.RELEASE'
is not necessary.
the second is that is there a way to define the VM argument -javaagent:<pathTo>/springloaded-{VERSION}.jar -noverify
in build.gradle.
i see the gradle document. In my build.gradle,the comment code is showing
//apply plugin: 'application'
//applicationDefaultJvmArgs = ['-javaagent:E:\\xgsdk\\commonLib\\springloaded-1.2.5.RELEASE.jar -noverify']
but it is not working.