AlexFalappa / nb-springboot

NetBeans IDE plugin supporting programming with Spring Boot
Apache License 2.0
157 stars 42 forks source link

JVM arguments not working with spring boot 2.0.0 #136

Open m-i-c-h-a-l opened 6 years ago

m-i-c-h-a-l commented 6 years ago

At this moment adding a property in jvm arguments generates this line: run.jvmArguments=-Xdebug This is valid for spring boot version < 2.0.0, for 2.0.0 it must be spring-boot.run.jvmArguments=-Xdebug

I think there are more properties which needs this "spring-boot" prefix in 2.0.0.

snicoll commented 6 years ago

I think there are more properties which needs this "spring-boot" prefix in 2.0.0.

All of them.

AlexFalappa commented 6 years ago

Spring Boot 2.0 is fully supported in NB Spring Boot plugin 2.0, I guess you are using a previous version.

Unfortunately the new version is not available yet from the Update Center as it is under verification. You should manually install the latest plugin downloading it from Github here or from the NetBeans Plugin Portal.

AlexFalappa commented 6 years ago

Just checked the Plugins Portal, it seems the plugin has been verified for NetBeans 8.1 only, verification for NetBeans 8.2 is still ongoing.

m-i-c-h-a-l commented 6 years ago

I installed the plugin manually from nb plugin portal. The downloaded plugin file had version 2.0 in it`s name, so I thought it was plugin version 2.0 with the support for Spring Boot 2.

AlexFalappa commented 6 years ago

@anaq1 if you have NB Spring Boot plugin v2.0 then something else is going on. Could you detail your steps? Please specify if you generated a new project, opened an existing project generated with previous plugin version or you opened a project from elsewhere.

m-i-c-h-a-l commented 6 years ago

I checked the version of the plugin in NB, it says: Version: 2.0 Source: 1520272898_nb-springboot-plugin-2.0.nbm

When I create new project from template"Spring boot basic project", the project has following "Run project" action properties:

run.jvmArguments=-noverify -XX:TieredStopAtLevel=1
run.mainClass=com.example.BasicApplication
Env.SPRING_OUTPUT_ANSI_ENABLED=always

I added spring.flyway.enabled propety in Spring Boot tab in project properties and these lines were changed to:

spring-boot.run.mainClass=com.example.BasicApplication
spring-boot.run.jvmArguments=-noverify -XX:TieredStopAtLevel=1
Env.SPRING_OUTPUT_ANSI_ENABLED=always
spring-boot.run.arguments=--spring.flyway.enabled=false

Using the plugin on existing Spring Boot 2 project (created manually, I installed the plugin afterwards) I set manually the "Debug" action in NB this way (working configuration):

spring-boot.run.jvmArguments=-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -Dspring.flyway.enabled=false
Env.SPRING_OUTPUT_ANSI_ENABLED=always
jpda.listen=true

After I installed the plugin, the Spring Boot tab was empty, so I added spring.flyway.enabled in "Override configuration properties" list. This changed the debug action:

spring-boot.run.jvmArguments=-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -Dspring.flyway.enabled=false
Env.SPRING_OUTPUT_ANSI_ENABLED=always
jpda.listen=true
run.jvmArguments=-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address}
run.arguments=--spring.flyway.enabled=false

So I tried to delete everything from the action - Spring Boot tab stayed the same (the flyway property still present). So I removed and added the spring.flyway.enabled property once again, which leads the debug action changed to:

run.jvmArguments=-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address}
jpda.listen=true
run.arguments=--spring.flyway.enabled=false

The run action changed to: run.arguments=--spring.flyway.enabled=false This is wrong.

It looks like the plugin is generating wrong properties in 2 situations:

  1. Creating new project from basic project template. But this is solved immediately after changing something in Spring Boot project properties.
  2. Using plugin on manually created project

Hope this description helps.

AlexFalappa commented 6 years ago

Excellent analysis @anaq1 !

I will open a separate issue for the first point in your last list.

As for point two working with existing projects (not generated via basic or Initializr wizard) is indeed not optimal and has already been reported by other users (see issue #130).

Will keep this open as a use case when improving the experience with existing projects.