Gradle javaexec task ignores jvmargs

I am trying to run my application using the Gradle javaexec task. However, jvmargs and args are not passed to the command. Why?

task runArgoDev(type: JavaExec) { main = "org.app.ArgoDevRunner" classpath = configurations.testRuntime project.ext.jvmargs = ['-Xdock:name=Argo', '-Xmx512m', '-Dfile.encoding=UTF-8', '-Dapple.awt.textantialiasing=on', '-ea'] project.ext.args = ['-initParameter', 'implicit-scrollpane-support=true'] 

}

+7
build.gradle gradle
source share
2 answers

The above code does not have the desired effect, because it sets the additional properties of the project object instead of setting up the task. Right - jvmArgs = ... and args = ... (You can also omit = , [ and ] .)

+7
source share

Here is an example to pass software args and jvmargs to run a task in gradle.

 run { args 'server', 'test.yml' jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005' } 
+6
source share

All Articles