TomEE Embedded LiveReload support
Livereload is a great tool with plugins for most of modern browsers but setting it up on your server can be a pain.
If you use tomee-embedded-maven-plugin this setup is made pretty simple and the only constraint is to not develop with root context (livereload will use it):
<plugin>
<groupId>org.apache.tomee.maven</groupId>
<artifactId>tomee-embedded-maven-plugin</artifactId>
<version>7.0.1</version>
<configuration>
<context>/app</context>
<withLiveReload>true</withLiveReload>
</configuration>
</plugin>
This is the minimalistic version but then just run mvn tomee-embedded:run and livereload endpoint is deployed ready to update your pages on changes.
If you want more control over livereload you can configure it with a dedicated block. This is particularly interesting if you change the port (because you use for two applications) or if your monitored folder is not the default one (default will be your docBase which has as default src/main/webapp):
<plugin>
<groupId>org.apache.tomee.maven</groupId>
<artifactId>tomee-embedded-maven-plugin</artifactId>
<version>7.0.1</version>
<configuration>
<context>/app</context>
<withLiveReload>true</withLiveReload>
<liveReload>
<watchedFolder>src/main/frontend</watchedFolder>
<path>/</path>
<port>35729</port>
</liveReload>
</configuration>
</plugin>
Once your application deployed with such a configuration, go in your browser, hit livereload button and update your frontend code!
Happy javascript development!
From the same author:
In the same category: