How to pass JVM arguments and script argument using GroovyShell?
问题 So I have a Groovy script: // TestScript.groovy println args Then in a Gradle task I have test { String profile = System.getenv("spring.profiles.active") jvmArgs '-Dspring.profiles.active=$profile" // THIS DOES NOT WORK! :( doLast { new GroovyShell().run(file('package.TestScript.groovy')) } } What I need to do is two things: a) Pass into TestScript.groovy program arguments so it will print out the args array b) Pass to JVM the Spring Boot profile i.e. spring.profiles.active=dev Any