Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot run with or without Maven? JSPs are not resolved without

When creating a Spring Boot application, in development environment, IntelliJ Idea creates a Run Configuration that is without Maven and it directly calls the static Main method with type of 'Spring Boot'.

When I run without Maven my JSP template files are not being resolved and I get the error page below.

When I run with Maven they are resolved but I can't debug. I am seeing some POM.xml configuration to be able to attach the debugger but then it debugs all the time even when I fire the app with Run and not Debug.

Should I run Boot app without Maven at all?
If I shouldn't, is this how the debug should be?
I feel something is wrong here...

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Thu Mar 16 08:53:54 GMT 2017
There was an unexpected error (type=Not Found, status=404).
No message available

I believe I see this error page because it tries to locate my index.jsp, can't find it, then tries for error.jsp and can't find that as well.

like image 555
Seregwethrin Avatar asked Nov 30 '25 16:11

Seregwethrin


1 Answers

Okay after doing more research it seems it is right to run Spring Boot application through the Main method directly rather than Maven in development environment.

Issue with JSPs are not being rendered without Maven was the Tomcat Jasper dependency's scope was <scope>provided</scope>, after changing that to "compiled" or "runtime" it started to work without maven. Interestingly when it was "provided" JSP rendering was only working with Maven.

like image 60
Seregwethrin Avatar answered Dec 02 '25 06:12

Seregwethrin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!