You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that mvn spring-boot:run also works if the content of webapp/src/main/webapp is copied in a folder src/main/webapp in the parent module (obviously the place expected by the spring-boot maven plugin if operating in single module mode).
Is there a clean solution for this problem?
I tried some of the parameters described here but maybe I've used them incorrectly or tried the wrong ones... ;-)
The text was updated successfully, but these errors were encountered:
This looks like a bug in Boot's Maven plugin to me. By default, the run goal's default working directory should be the basedir of the Maven project being built but that does not appear to be the case. Instead, the working directory is the directory in which Maven was invoked. You can work around the problem by adding the following to the configuration of spring-boot-maven-plugin in your webapp project:
wilkinsona
changed the title
spring-boot:run problem with JSPs in a multi module maven project
spring-boot:run uses the wrong default working directory for a forked JVM
May 24, 2019
I would like to migrate some ancient multi module spring application containing lots of JSPs to spring-boot.
I know https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-jsp-limitations but some preceding (single module) tests all ran fine.
Since I would like to preserve the multi module structure, I first ran into a problem, which fortunately has been solved here: #3436
So, I can start my multi module project with the usual
mvn spring-boot:run
but unfortunately JSPs can not be served this way!I created a simple example project https://github.com/drahkrub/spring-boot-multi-module-jsp (a simplified version of https://github.com/spring-projects/spring-boot/tree/v2.1.4.RELEASE/spring-boot-samples/spring-boot-sample-tomcat-jsp turned into a multi module project) with the following minimalistic content:
Now, if started with
mvn spring-boot:run
(ormvn -pl webapp -am spring-boot:run
) http://localhost:8080/ givesBut if running the WAR file, i.e.
mvn clean package
followed byhttp://localhost:8080 works as expected.
I noticed that
mvn spring-boot:run
also works if the content ofwebapp/src/main/webapp
is copied in a foldersrc/main/webapp
in the parent module (obviously the place expected by the spring-boot maven plugin if operating in single module mode).Is there a clean solution for this problem?
I tried some of the parameters described here but maybe I've used them incorrectly or tried the wrong ones... ;-)
The text was updated successfully, but these errors were encountered: