jvmArguments configuration parameter foces "fork=true" configuration parameter.
First issue: there is nothing about it in documentation. The only mention is "JVM arguments that should be associated with the forked process used to run the application" which is not really clear and doesn't articulate forked process implication.
The second issue: "stop" goal is not able to stop process because of JMX admin bean absence. Actually even start is not able to detect started application.
This means e.g. that if port is set via
Also sometimes Tomcat freezes on some OSes (with Docker) which requires
-Djava.security.egd=file:/dev/./urandom parameter. And integration tests fail also without additional
Comment From: snicoll
First issue: there is nothing about it in documentation.
By default the application is executed directly from the Maven JVM. If you need to run in a forked process you can use the 'fork' option. Forking will also occur if the 'jvmArguments' or 'agent' options are specified.
Let's not create a meta-issue please and focus on the "second" issue. Can you share a sample that reproduces the problem?
Comment From: denis-anisimov
I don't see such clarification in the parameter description here: http://docs.spring.io/spring-boot/docs/current/maven-plugin/start-mojo.html#jvmArguments
The link you provided contains a lot of text and people usually don't read a whole text. The only important thing for me is a parameter and its detailed description. It doesn't contain the clarification I need. But it's up too you.
Unfortunately I don't have simple example. But it should be easy to create. Any Spring boot application should have the issue. I don't see any specific in this.
But you can use for a reference this PR: https://github.com/vaadin/framework8-demo/pull/10
Just remove <fork>true</fork>
and you will see a difference in mvn verify
Comment From: snicoll
I was trying to mitigate the "nothing" statement on your end. If you're not happy with the doc, feel free to submit a PR that contains the clarification that you need. IMO, having jvmArguments
enabling fork mode is sane and quite understandable (otherwise we would just ignore them!).
Is it too much to ask you to build a sample? The reason I am asking is that we have integration tests for start/stop with and without forking so providing a sample is the fastest way to get some feedback.
Comment From: denis-anisimov
Yep, sorry. My bad. Should have been specific about parameter doc with the link.
I can build a sample, sure. No problem. But what do you want to get as a result ? Just a binaries ? The problem is not in binaries but in the build procedure: verification....... So I'm not sure how binaries will help to you.
Comment From: snicoll
Here's my take at this. You're complaining that jvmArguments
enables fork
mode and the only sample that you give me has <fork>true</fork>
in it. Then, looking at your sample, there's a bunch of background regarding travis and tomcat that aren't related to Boot AFAIK. I think we can both agree this is confusing.
Let's focus on one problem here. What is the problem? I still don't know! Since we have integration tests, please provide a sample (a simple project) where I can run "mvn verify" and it breaks. And if you have more than one case, just create another issue with a dedicated description and, ideally, a sample.
Is that more clear?
Comment From: denis-anisimov
Clear.
As I said from the very beginning: remove <fork>true</fork>
from the sample and run mvn verify
.
It will fail.
That's the problem.
I will see if I can provide a simple sample project. Feel free to close as not reproducible.
Comment From: snicoll
I think I got it.
Comment From: snicoll
Yeah ok I got it. Please consider attaching any kind of error log you get next time...
[INFO] [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.1.BUILD-SNAPSHOT:stop (post-integration-test) on project start-stop-automatic-fork: Spring application lifecycle JMX bean not found (fork is null). Could not stop application gracefully: org.springframework.boot:type=Admin,name=SpringApplication -> [Help 1]
Comment From: snicoll
Actually, this is kind of what is expected:
Flag to indicate if the run processes should be forked. Must be aligned to the value used to StartMojo start the process
In light of your project, that's a bit naive so let's see if we can do something better there.
Comment From: ghost
What is the fix now? The documentation is a little bit misleading in this respect.. It suffices to start mvn verify, without the spring-boot:start before and/or the spring-boot:stop after the verify..
Comment From: snicoll
@axel-krebs this issue is over 3 years old so that's a bit hard to see what you're talking about. If you have a small sample with a supported Spring Boot version that exhibits the problem you're describing, please create a separate issue.
Comment From: ionel-sirbu-crunch
What is the fix now? The documentation is a little bit misleading in this respect.. It suffices to start mvn verify, without the spring-boot:start before and/or the spring-boot:stop after the verify..
If you start your app via mvn spring-boot:start
, then fork mode is enabled by default. However, when you run mvn spring-boot:stop
, fork mode is no longer defaulted to true
(it's null), so you need to specify it, i.e. add -Dspring-boot.stop.fork
to your command.