Pass Java agent parameters from Gradle to Intellij Idea


(Baris) #1

Hello Everyone,

I need to pass spring-instrument.jar absolute path via gradle to Idea, for IT tests. Then, I will assign this env. var as -javaagent

dependencies {
runtime 'org.springframework:spring-instrument:4.3.2.RELEASE’
runtime 'org.aspectj:aspectjweaver:1.8.9’
runtime ‘org.springframework:spring-instrument-tomcat:4.3.2.RELEASE’
}

I wrote a simple task but it does not work, it gives below error

Could not find method environment() for arguments [SPRING_INSTR_PATH ...