Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JVM arguments not working with spring boot 2.0.0 #136

Open
m-i-c-h-a-l opened this issue Mar 21, 2018 · 7 comments
Open

JVM arguments not working with spring boot 2.0.0 #136

m-i-c-h-a-l opened this issue Mar 21, 2018 · 7 comments

Comments

@m-i-c-h-a-l
Copy link

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
Copy link

snicoll commented Mar 21, 2018

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

All of them.

@AlexFalappa
Copy link
Owner

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

@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
Copy link
Author

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants