Java Shell
Clone or download


spring session


Spring Session MongoDB

Greg Turnquist

Spring Session MongoDB provides a solution for Spring Session in a MongoDB data store.

  • Accessing a session from any environment (i.e. web, messaging infrastructure, etc)

  • In a web environment

    • Support for clustering in a vendor neutral way

    • Pluggable strategy for determining the session id

    • Easily keep the HttpSession alive when a WebSocket is active

Building Spring Session MongoDB

  1. Run mvn clean package

This will generate the artifact.

You can also import the project into your IDE.

Releasing Spring Session MongoDB

Snapshots are published automatically via CI server by doing this:

$ USERNAME=<username> PASSWORD=<encrypted password> mvn -Pdistribute,snapshot,docs clean deploy
Snapshots do NOT include GPG signatures. To do so would require putting a private key on the CI server. The process for releases (below) is manual and DOES include GPG signatures.

To do a release (.RELEASE, .RC?, .M?):

  1. Check in all changes and ensure there are no edited files.

  2. Bump up the version in pom.xml to the desired version and commit the change.

  3. git tag <version> (like v2.0.1.RELEASE)

  4. Execute a maven deploy.

    • For a milestone: USERNAME=<user> PASSWORD=<encrypted password> mvn -Pdistribute,milestone,docs clean deploy

    • For a release: USERNAME=<user> PASSWORD=<encrypted password> mvn -Pdistribute,release,docs clean deploy

    • For a release to maven central: USERNAME=<user> PASSWORD=<nexus password> mvn -Pdistribute,gpg,central clean deploy -s settings.xml (At SonaType, close and releases)

  5. Bump up the version in pom.xml again to the next BUILD-SNAPSHOT.

  6. Commit the change.

  7. git push

  8. git push --tags

  9. Inspect handiwork at or

A word about reference documentation. Based upon this, the distribute profile contains an artifactory property that is applied to the ZIP file generated by the docs profile. A CRON job will scoop up the zipped up docs and unpack them inside the target location.

Code of Conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to

Spring Session Project Site

You can find the documentation, issue management, support, samples, and guides for using Spring Session MongoDB at


Spring Session is Open Source software released under the Apache 2.0 license.