我使用IntelliJ运行SpringBoot。 intellij run
group 'helloworld'
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'application'
apply plugin: 'org.springframework.boot'
sourceCompatibility = 1.8
configurations {
runtimeAgent
}
buildscript {
}
dependencies {
runtimeAgent "org.springframework:spring-instrument"
runtimeAgent "org.aspectj:aspectjweaver"
}
/** I want this option to work together. When run with IntelliJ **/
bootRun.doFirst {
def springInstrument = "-javaagent:" + configurations.runtimeAgent[0].absolutePath
def aspectJWeaver = "-javaagent:" + configurations.runtimeAgent[1].absolutePath
applicationDefaultJvmArgs = [springInstrument, aspectJWeaver]
}
当我运行intelliJ时,我想同时运行“ bootRun.doFirst”选项。 我找不到办法。救命。谢谢。