vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
622 stars 166 forks source link

Production Build using Vaadin 24.5.6 starts in Development Mode when started from IDE #20581

Open FelixLanghof opened 2 days ago

FelixLanghof commented 2 days ago

Description of the bug

When building a Vaadin application using the production profile and starting it from an IDE, it will start up in Development Mode. Tested with Eclipse and IntelliJ.

Expected behavior

The application starts in production mode. As is the case with Vaadin 24.4.18.

Minimal reproducible example

Using Vaadin 24.4.18, when following the same steps, the application starts in Production Mode Using plain mvn install -Pproduction and java -jar or mvn spring-boot:run -Pproduction works fine.

Versions

Artur- commented 2 days ago

Any particular reason why you would expect it to start in production mode in your IDE because you made a build outside the IDE?

The production artifact is the jar file in the target folder and that one runs in production mode. That the production artifact affected IDE behavior was a bug that was fixed in #20294

FelixLanghof commented 2 days ago

Since it was the behavior thus far :) I sometimes run a production install (for testing) through my IDE. So it seemed only natural to me, that starting the application from the IDE afterwards would result in it running in production mode. If the previous behavior is considered incorrect, I would accept that.

It would however be nice to be able to start the application in production mode with all the same configurations as in development mode (i.e. Spring Profiles etc.). If I enable the production maven profile for the project as a whole, starting the application via the IDE results in an error:

no DevModeHandlerManager implementation found but but dev server enabled. Either disable by setting vaadin.frontend.hotdeploy=false (and run the build-frontend maven goal) or include the vaadin-dev-server dependency

Even adding vaadin.frontend.hotdeploy=false to the application.properties, rebuilding and rerunning does not work.

knoobie commented 2 days ago

It would however be nice to be able to start the application in production mode with all the same configurations as in development mode

You can do that by going to your target folder and execute java -jar "your arguments" app.jar

FelixLanghof commented 2 days ago

You can do that by going to your target folder and execute java -jar "your arguments" app.jar

I know, but "your arguments" might be something more complex. I'm not saying that it isn't possible, just inconvenient. I understand if you consider the previous behavior a bug, never thought I'd be the guy on the other side of this https://xkcd.com/1172/ :)