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

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

Open
FelixLanghof opened this issue Nov 29, 2024 · 5 comments

Comments

@FelixLanghof
Copy link

FelixLanghof commented Nov 29, 2024

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

  • Download the Hello World Project from https://start.vaadin.com/app (Flow/Java/Maven/Spring Boot)
  • (Check that Vaadin Version is 24.5.6)
  • Run mvn install -Pproduction (in IDE or otherwise)
  • Start application via IDE
    • In Eclipse using Spring Boot Dashboard or basic Java Application Run Configuration
    • In IntelliJ using basic Run Configuration

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

  • Vaadin / Flow version: 24,5,6
  • Java version: 17/21
  • OS version: Win10
  • IDE (if applicable):
    • Eclipse 2024-09
    • IntelliJ 2024.3
@Artur-
Copy link
Member

Artur- commented Nov 29, 2024

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

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

knoobie commented Nov 29, 2024

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

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/ :)

@mshabarov
Copy link
Contributor

The real question seems to be "How I can run my Vaadin app in production with the IDE run configuration", so that you don't actually need the mvn install -Pproduction step to run.
IntelliJ IDEA provides an option to run the spring boot maven plugin with the IDEA run configuration where you can add your system properties.
Have you tried that? What prevents you to run this way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🆕 Needs triage
Development

No branches or pull requests

4 participants