DEV Community

Discussion on: Run React Frontend and SpringBoot Backend on the same port and Package them as a single artifact !!

Collapse
 
ivanbo97 profile image
ivanbo97 • Edited

Hello and thank you for the in-depth tutorial !

In case someone is interested. There is also an alternative way of combining create-react-app with Spring Boot in a single artifact which does not require adding of maven-resources-plugin. In configuration part of frontend-maven-plugin you just need to set an environment variable with the name BUILD_PATH (ref : create-react-app.dev/docs/advanced...) and value ${basedir}/target/classes/static . In this way you are forcing frontend-maven-plugin to output the generated production build directly in target/classes/static. Therefore, we do not need maven-resources-plugin for making intermediate copies. I hope it makes sense.