I just started looking into lift today but I ran into an issue where I
could not make hot changes to class files without having to restart
jetty because Derby would complain it was already bound. I was
searching around on here and found this issue:
http://groups.google.com/group/liftweb/browse_thread/thread/9dcf84464dc07cce/c0cadcc4e6a3b472?lnk=gst&q=Another+instance+of+Derby#c0cadcc4e6a3b472
I've had simlilar issues with embedded libraries before and I was able
to resolve this issue by making derby a dependency in jetty rather
than of the app like so:
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<configuration>
<contextPath>/</contextPath>
<scanIntervalSeconds>5</scanIntervalSeconds>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.4.2.0</version>
</dependency>
</dependencies>
</plugin>
Not only does this make Jetty manage Derby so redeploying will not
create a new Derby instance but it also keeps the app database
independent. You can then either remove Derby as a regular dependency
or put it as <scope>provided</scope> so that Maven will not package it
in your warfile.
Is anyone else having this issue? Should I open a ticket in the issue
tracker for the archetype? Maybe everyone knows to do this but it was
annoying for a first timer like me who just started with the
archetype, especially after the annoyance that archetype:generate menu
generates an old archetype and won't upgrade to v1.0.
Thanks!