Skip to content

Instantly share code, notes, and snippets.

@kdabir
Created February 22, 2012 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdabir/1885388 to your computer and use it in GitHub Desktop.
Save kdabir/1885388 to your computer and use it in GitHub Desktop.
Configuring jetty plugin to auto deploy and store session between restarts in Maven
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.24</version> <!-- TODO upgrade to version 7 -->
<configuration>
<stopPort>9669</stopPort>
<stopKey>${appname}</stopKey>
<!-- Redeploy every x seconds if changes are detected,
0 for no automatic redeployment -->
<scanIntervalSeconds>3</scanIntervalSeconds>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>7770</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<webAppConfig>
<contextPath>/${appname}</contextPath>
<sessionHandler implementation="org.mortbay.jetty.servlet.SessionHandler">
<sessionManager implementation="org.mortbay.jetty.servlet.HashSessionManager">
<storeDirectory>${project.build.directory}/sessions</storeDirectory>
</sessionManager>
</sessionHandler>
</webAppConfig>
</configuration>
</plugin>
@nilsschmidthamburg
Copy link

Nice! Just what I was looking for :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment