Autoloading with play2
This is my play2 project with maven character:
pom.xml with the appropriate code:
<packaging>play2</packaging>
<plugin>
<groupId>com.google.code.play2-maven-plugin</groupId>
<artifactId>play2-maven-plugin</artifactId>
<version>${play2.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<!-- only if using database evolutions -->
<serverJvmArgs>-DapplyEvolutions.default=true</serverJvmArgs>
</configuration>
<executions>
<!-- only if there are assets in the project -->
<execution>
<id>default-play2-compile-assets</id>
<goals>
<goal>closure-compile</goal>
<goal>coffee-compile</goal>
<goal>less-compile</goal>
</goals>
</execution>
</executions>
</plugin>
I run the project with the command:
mvn play2:run
But every time I make any changes to the file I have to do mvn compile play2:run
and then reload the page.
Isn't there some function to reload with current changes without compiling every time?
Note:
I found that using mvn play2:run
it always runs in mode PROD
. So this seems to be the problem. Not sure how to start it in mode DEV
.
Console:
[play] [info] play - Application started (Prod)
[play] [info] play - Listening for HTTP on /0:0:0:0:0:0:0:0%0:9000
The only way I have found is to use activator
instead:
activator run
And to run on a specific port say 9543
use:
activator run -Dhttp.port=9543
Startup in DEV mode and automatic reboot functions are not yet implemented.
I started working on these features recently, but it's not easy and I can't predict that it will be available. Unfortunately.