-
Notifications
You must be signed in to change notification settings - Fork 169
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
add support for spring-boot:run
into flow-maven-plugin
#3514
Comments
Would |
@tsuoanttila does not looks like that. The documentation says it adds more folders to the classpath, but apparently not to the servlet context. I've tried adding the <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<folders>
<folder>${project.build.directory}/${project.build.finalName}</folder>
</folders>
</configuration>
</plugin> |
I ended up using the default config for the flow maven plugin (outputs the transpiled frontend sources to With that approach both the .war context and the |
Now the plugin is able to remove the external directories: #3540 |
Issue moved to vaadin/spring #267 via ZenHub |
As a developer I want to use the Spring Boot maven plugin to run my Flow app in the production mode (because running the
spring-boot:run
maven goal is easier then deploying a .war file to a servlet container, and because it's easier to debug the app started that way). Currently (with the version 1.0.0.alpha19 of the flow-maven-plugin) that requires extra configuration and manual action when re-building the app.The flow-maven-plugin runs a Gulp build script and outputs production-ready frontend files into the folder defined in the
transpileOutputDirectory
configuration property (${project.build.directory}/${project.build.finalName}/
by default).When the app is packaged in a .war file, this would be the context root. That matches the default context paths for the frontend resources expected by Flow (see
FRONTEND_URL_ES5_DEFAULT_VALUE
). However, when the app is started withspring-boot:run
, the context root issrc/main/webapp
, and Flow would search for frontend resources there.When the app started with
jetty:run
, this can be worked around by instructing the Maven Jetty plugin to add extra resource folders to the context:But there is no similar parameters for the Spring-Boot Maven plugin.
A semi-OK workaround for this issue is to configure the Flow Maven plugin to output the transpiled frontend code into a subfolder in
src/main/webapp
(<transpileOutputDirectory>${frontend.directory}/build</transpileOutputDirectory>
), and then also override the default Flow settings for the frontend resource folders with-Dvaadin.frontend.url.es5=context://frontend/build/frontend-es5/
and-Dvaadin.frontend.url.es6=context://frontend/build/frontend-es6/
.The problem with this workaround (apart from the fact that it adds generated code into the source folder) is that when running the flow-maven-plugin in the second time, the Gulp build script fails to clean the output folder (because it is outside of the Gulp's working directory):
That is, this workaround requires deleting the build output folder manually. Please improve the developer experience for this use case.
The text was updated successfully, but these errors were encountered: