[Lift] Re: getting mvn jetty:run to reload changes to snippets
2009/4/17 David Pollak feeder.of.the.be...@gmail.com: On Fri, Apr 17, 2009 at 10:00 AM, James Strachan james.strac...@gmail.com wrote: Hello Lifters! BTW apologies in advance if this is an obvious newbie question - I did a fair bit of searching on the list and saw JavaRebel discussions etc. I've been taking my first baby steps with Scala/Lift (this Scala/Lift malarkey is starting to grow on me) so I followed the getting started guide. My first surprise (after using Rails/JSP etc) was hitting reload on a browser after changing a snippet doesn't reload the snippet code - you've gotta stop/restart mvn jetty:run. (Though changing the template does). I just wondered if someone had figured out the ninja to get the jetty:run plugin to auto-detect snippet changes? This could well be a tooling issue (e.g. when using eclipse with its incremental compiling generating new class files might solve the problem) - I'm using IDEA currently. I did wonder if we could come up with a way to configure the jetty:run plugin to do the right thing though irrespective of your IDE; using the scala incremental compiler maybe? I tried adding a jetty custom scan target to the pom... plugin groupIdorg.mortbay.jetty/groupId artifactIdmaven-jetty-plugin/artifactId configuration contextPath//contextPath scanIntervalSeconds1/scanIntervalSeconds scanTargetPatterns scanTargetPattern directorysrc/main/scala/directory includes include**/*.scala/include /includes /scanTargetPattern /scanTargetPatterns /configuration /plugin which forces a restart fine - but it doesn't know to recompile the Scala code. So I'm wondering if we setup the scala compiler to auto build the code to a classes directory that the jetty plugin can then auto-detect and restart the web app? This command line will keep the class files up to date. Using JavaRebel is better than having Jetty reload the classes and Jetty will destroy sessions on reload. mvn scala:cc Many thanks, that worked a treat. For those following this thread; the instructions here worked a treat... http://wiki.liftweb.net/index.php?title=JavaRebel in one shell I run mvn jetty:run then in another I run mvn scala:cc and it works like a charm! -- James --- http://macstrac.blogspot.com/ Open Source Integration http://fusesource.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: getting mvn jetty:run to reload changes to snippets
Switch to the one and only great IDE: Eclipse ;-)But be sure to use the latest Scala IDE for Eclipse (2.7.4 RC1 or later). Then you will have lots of fun! 2009/4/17 James Strachan james.strac...@gmail.com Hello Lifters! BTW apologies in advance if this is an obvious newbie question - I did a fair bit of searching on the list and saw JavaRebel discussions etc. I've been taking my first baby steps with Scala/Lift (this Scala/Lift malarkey is starting to grow on me) so I followed the getting started guide. My first surprise (after using Rails/JSP etc) was hitting reload on a browser after changing a snippet doesn't reload the snippet code - you've gotta stop/restart mvn jetty:run. (Though changing the template does). I just wondered if someone had figured out the ninja to get the jetty:run plugin to auto-detect snippet changes? This could well be a tooling issue (e.g. when using eclipse with its incremental compiling generating new class files might solve the problem) - I'm using IDEA currently. I did wonder if we could come up with a way to configure the jetty:run plugin to do the right thing though irrespective of your IDE; using the scala incremental compiler maybe? I tried adding a jetty custom scan target to the pom... plugin groupIdorg.mortbay.jetty/groupId artifactIdmaven-jetty-plugin/artifactId configuration contextPath//contextPath scanIntervalSeconds1/scanIntervalSeconds scanTargetPatterns scanTargetPattern directorysrc/main/scala/directory includes include**/*.scala/include /includes /scanTargetPattern /scanTargetPatterns /configuration /plugin which forces a restart fine - but it doesn't know to recompile the Scala code. So I'm wondering if we setup the scala compiler to auto build the code to a classes directory that the jetty plugin can then auto-detect and restart the web app? I just wondered if others had hit this issue come up with an elegant solution; to force incremental compilation of the Scala class files - or maybe I should just switch to eclipse? -- James --- http://macstrac.blogspot.com/ Open Source Integration http://fusesource.com/ -- Heiko Seeberger www.heikoseeberger.name OSGi on Scala --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---