Agile Zone is brought to you in partnership with:

Mark is a graph advocate and field engineer for Neo Technology, the company behind the Neo4j graph database. As a field engineer, Mark helps customers embrace graph data and Neo4j building sophisticated solutions to challenging data problems. When he's not with customers Mark is a developer on Neo4j and writes his experiences of being a graphista on a popular blog at http://markhneedham.com/blog. He tweets at @markhneedham. Mark is a DZone MVB and is not an employee of DZone and has posted 519 posts at DZone. You can read more from them at their website. View Full User Profile

Sbt: Rolling with continuous/incremental compilation and Jetty

06.11.2011
| 1028 views |
  • submit to reddit

As I mentioned in an earlier post we’re using SBT on our project and one of it’s cool features is that it will listen to the source directory and then automatically recompile the code when it detects file changes.

We’ve also installed the sbt-jetty-embed plugin which allows us to create a war which has Jetty embedded so that we can keep our application containerless.

That plugin adds an action called ‘jetty’ to sbt so we (foolishly in hindsight) thought that we would be able to launch the application in triggered execution mode by making use of a ~ in front of that:

$ ./sbt
> ~jetty

 

Unfortunately that doesn’t do any continuous compilation which left us quite confused until we realised that RTFM might be a good idea…

What we actually needed to launch the application locally and edit code/see changes as if it’s written in a dynamic language was the following:

$ ./sbt
> jetty-run
> ~ prepare-webapp

 

References
Published at DZone with permission of Mark Needham, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Tags: