devsoap/ds-gradle-vaadin

Debugging bootRun task

Closed this issue · 1 comments

Desktop (please complete the following information):

  • OS: Windows
  • JDK version: 11
  • Gradle version: 5
  • Vaadin Plugin version: 1.1.1

Describe the bug
In my spring boot + gradle + Vaadin gradle plugin project, I want to debug my application using the bootRun task executed by IntellJ IDEA. This is not possible because:

Task :ui:bootRun FAILED
Excluding []
Task ':ui:bootRun' is not up-to-date because:
Task has not declared any outputs despite executing actions.
Starting process 'command 'C:\Program Files\Java\jdk-11.0.1+13\bin\java.exe''. Working directory: D:\path\ Command: C:\Program Files\Java\jdk-11.0.1+13\bin\java.exe -Dvaadin.productionMode=false -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=65297 -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=65297 -Dfile.encoding=windows-1252 -Duser.country=DE -Duser.language=de -Duser.variant -cp ...
Successfully started process 'command 'C:\Program Files\Java\jdk-11.0.1+13\bin\java.exe''
ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.
Error occurred during initialization of VM
agent library failed to init: jdwp
:ui:bootRun (Thread[Execution worker for ':' Thread 3,5,main]) completed. Took 1.067 secs.

The remote debugging agent stuff is doubled for unknown reason. I am not sure how IntelliJ makes it possible to debug, but usually this worked with gradle tasks like bootRun.

To Reproduce
I will provide additional information as required. Starting in non-debug mode works fine.

Expected behavior
Debugging should be possible.

Additional context
Maybe the following line is a problem:
https://github.com/devsoap/gradle-vaadin-flow/blob/2cb01525119c4a5f942905527c8612a5d64afa8d/src/main/groovy/com/devsoap/vaadinflow/actions/SpringBootAction.groovy#L103

Changing SpringBootAction:103 to this fixes the problem:
bootRun.jvmArgs(["-Dvaadin.productionMode=$vaadin.productionMode".toString()])

Here is a patch file:
Issue_#238.zip