
= Spring Session MongoDB

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

== Project Status

We go to great lengths to ensure smooth upgrades. We also seek to make your upgrade on major versions of Java can be as smooth
as possible.

Check the matrix below to see the status of supported versions:

.Spring Session for MongoDB Status
[cols=3]
|===
| Job | `master` branch (`2.1`) | `2.0.x` branch (`2.0.x`)

| Test - JDK 8
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb/jobs/Test%20-%20JDK%208/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb"]
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb-2.0.x/jobs/Test%20-%20JDK%208/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb-2.0.x"]

| Test - JDK 8 and Spring.NEXT
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb/jobs/Test%20-%20JDK%208%20and%20Spring.NEXT/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb"]
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb-2.0.x/jobs/Test%20-%20JDK%208%20and%20Spring.NEXT/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb-2.0.x"]

| Test - JDK 8 and Spring.NEXT 5.1
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb/jobs/Test%20-%20JDK%208%20and%20Spring.NEXT%205.1/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb"]
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb-2.0.x/jobs/Test%20-%20JDK%208%20and%20Spring.NEXT%205.1/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb-2.0.x"]

| Test - JDK 8 and Spring Data.NEXT
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb/jobs/Test%20-%20JDK%208%20and%20Spring%20Data.NEXT/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb"]
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb-2.0.x/jobs/Test%20-%20JDK%208%20and%20Spring%20Data.NEXT/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb-2.0.x"]

| Test - JDK 11
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb/jobs/Test%20-%20JDK%2011/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb"]
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb-2.0.x/jobs/Test%20-%20JDK%2011/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb-2.0.x"]

| Test - JDK 11 and Spring.NEXT
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb/jobs/Test%20-%20JDK%2011%20and%20Spring.NEXT/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb"]
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb-2.0.x/jobs/Test%20-%20JDK%2011%20and%20Spring.NEXT/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb-2.0.x"]

| Test - JDK 11 and Spring.NEXT 5.1
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb/jobs/Test%20-%20JDK%2011%20and%20Spring.NEXT%205.1/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb"]
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb-2.0.x/jobs/Test%20-%20JDK%2011%20and%20Spring.NEXT%205.1/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb-2.0.x"]

| Test - JDK 11 and Spring Data.NEXT
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb/jobs/Test%20-%20JDK%2011%20and%20Spring%20Data.NEXT/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb"]
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb-2.0.x/jobs/Test%20-%20JDK%2011%20and%20Spring%20Data.NEXT/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb-2.0.x"]

| Test - JDK 12*
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb/jobs/Test%20-%20JDK%2012/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb"]
|

| Test - JDK 12* and Spring.NEXT
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb/jobs/Test%20-%20JDK%2012%20and%20Spring.NEXT/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb"]
|

| Test - JDK 12* and Spring.NEXT 5.1
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb/jobs/Test%20-%20JDK%2012%20and%20Spring.NEXT%205.1/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb"]
|

| Test - JDK 12* and Spring Data.NEXT
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb/jobs/Test%20-%20JDK%2012%20and%20Spring%20Data.NEXT/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb"]
|

| Build - Release to repo.spring.io
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb/jobs/Build/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb"]
| image:https://ci.spring.io/api/v1/teams/spring-team/pipelines/spring-session-data-mongodb-2.0.x/jobs/Build/badge[link="https://ci.spring.io/teams/spring-team/pipelines/spring-session-data-mongodb-2.0.x"]
|===

IMPORTANT: Spring Session for MongoDB 2.1 runs on Spring Framework 5.1, which has support for *JDK 11*. Spring Session for MongoDB 2.0.x runs on Spring Framework 5.0 and is NOT supported on *JDK 11* despite our pipelines testing against it. The extra
tests are designed to give you a smooth upgrade path. If you are going into production on JDK 11, should need to be using Spring Session for MongoDB 2.1.

IMPORTANT: *JDK 12* is Java's latest version and is unstable. We are testing against it to catch issues early on, but don't support it directly on any version of Spring Session for MongoDB.

== Building Spring Session MongoDB

. Run `mvn clean package`

This will generate the artifact.

You can also import the project into your IDE.

== Releasing Spring Session MongoDB

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

. Check in all changes and ensure there are no edited files.
. Run `ci/create-release.sh <release version> <snapshot version>` e.g. (`ci/create-release.sh 2.1.1.RELEASE 2.1.2.BUILD-SNAPSHOT`)

From here, test things out locally.

. `git checkout release`
. `./mvn clean package`
. ...do all your testing...

Once verified, push the `release` branch to `origin` and let the CI server deploy it.

. `git push`

After a clean release, switch back to master branch and push the master development branch.

. `git checkout master`
. `git push`
. `git push --tags`

//To deploy your changes:
//
//. `git checkout release`
//. Execute a maven deploy.
//* For a milestone: `USERNAME=<user> PASSWORD=<encrypted password> ./mvnw -Pdistribute,milestone,docs clean deploy`
//* For a release: `USERNAME=<user> PASSWORD=<encrypted password> ./mvnw -Pdistribute,release,docs clean deploy`
//* For a release to maven central: `USERNAME=<user> PASSWORD=<nexus password> ./mvnw -Pdistribute,gpg,central clean deploy -s settings.xml` (At SonaType, *close* and *releases*)
//. Inspect handiwork at https://repo.spring.io/ or https://oss.sonatype.org/#stagingRepositories


CI server should build the new snapshot and automatically deploy to artifactory.

NOTE: A word about reference documentation. Based upon https://github.com/spring-projects/spring-framework/wiki/gradle-build-and-release-faq#user-content-wiki-docs_schema_dist_publication[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 link:CODE_OF_CONDUCT.adoc[code of conduct].
By participating, you  are expected to uphold this code. Please report unacceptable behavior to spring-code-of-conduct@pivotal.io.

= Spring Session Project Site

You can find the documentation, issue management, support, samples, and guides for using Spring Session MongoDB at http://projects.spring.io/spring-session-data-mongodb/

= License

Spring Session is Open Source software released under the http://www.apache.org/licenses/LICENSE-2.0.html[Apache 2.0 license].
