Add support for Java 10

This commit is contained in:
Greg Turnquist
2018-05-09 16:39:43 -05:00
parent 3eff1ac525
commit 4e42a83ca8
5 changed files with 65 additions and 30 deletions

View File

@@ -1,21 +1,44 @@
language: java
jdk:
- oraclejdk8
env:
matrix:
- PROFILE=non-existent
- PROFILE=spring5-next
- PROFILE=springdata-next
# Get latest install-jdk.sh script
before_install:
- wget https://github.com/sormuras/bach/raw/master/install-jdk.sh
matrix:
include:
- env: PROFILE=non-existent
jdk: oraclejdk8
- env: PROFILE=spring5-next
jdk: oraclejdk8
- env: PROFILE=springdata-next
jdk: oraclejdk8
- env: JDK='Open JDK 10' PROFILE=non-existent
install: . ./install-jdk.sh -F 10 -L GPL
- env: JDK='Open JDK 10' PROFILE=spring5-next
install: . ./install-jdk.sh -F 10 -L GPL
- env: JDK='Open JDK 10' PROFILE=springdata-next
install: . ./install-jdk.sh -F 10 -L GPL
- env: JDK='Oracle JDK 10' PROFILE=non-existent
install: . ./install-jdk.sh -F 10 -L BCL
- env: JDK='Oracle JDK 10' PROFILE=spring5-next
install: . ./install-jdk.sh -F 10 -L BCL
- env: JDK='Oracle JDK 10' PROFILE=springdata-next
install: . ./install-jdk.sh -F 10 -L BCL
cache:
directories:
- $HOME/.m2
os:
- linux
branches:
except:
- gh-pages
sudo: false
script: ./build.bash
notifications:
slack:
secure: fKLKkvaIVRK4l0f+PjFIZTwnVmgmFilKv1uS2XFFhFWPjAzSF0Qi0H2ZKt3cYRTbhNkUGksRbTivbvi9/p69lIpLn0HbM9p6theS7EdgP6O4VkDk9ubMysO9JZRp/5APJN3JJqHCC9gKCabyFwtsixKfzKhPtxNwhNiOAP7a/izuIdCq9Cl+lOskdFp3nAY3U8+Jk0zsE26TdRQ/7uOTDlWl4RU5h0UEr+AGxns+Du/K2efxpWrmOEjiIVQMSFGXJ3FBonX1XZcLu8RweLSARVcjPzZyOZgNWoziRvG9rprDRM6pZGEuSTDW/OIi3EcUezEXLkx5VxpaxS7ELNSBiQxsSpyWSIbTeUdA63n2VCSs5yfGJzuRG2zci0tSObEQtYNaSWoGFTW4EAliS4HmibN697vjoLO+s6mqc37YLkRa+aZctDHVKByDIgniOjz27/t1ZVgqVwOABfAjXxJyLLNrOkWoWAhwKWji+xvIIq+OK6TysWKs8ivTgJwMfeQ0yEEmo0/BaOONNvwUGgWX5/0xq4UvBJxIZzNbL6HUPBBUMCAJf+2t9S3zoBy2ML54ardhfk28jVOiH0lOLC/rQfQzCjM9FxQ4eBSy6TIdEJkCitfRrIVkDH23YmCuQl9nVrjwX+Jak6VRGvjYYs41N8dRxrN4cK6433LV9qyOvAA=

38
pom.xml
View File

@@ -68,7 +68,8 @@
<properties>
<source.level>1.8</source.level>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<assertj.version>3.8.0</assertj.version>
<assertj.version>3.9.1</assertj.version>
<flapdoodle.version>1.50.5</flapdoodle.version>
<hamcrest.version>1.3</hamcrest.version>
<jackson.version>2.9.1</jackson.version>
@@ -76,11 +77,11 @@
<mockito.version>2.18.3</mockito.version>
<mongo.version>3.5.0</mongo.version>
<mongo-reactivestreams.version>1.6.0</mongo-reactivestreams.version>
<reactor.version>Bismuth-SR6</reactor.version>
<spring.version>5.0.4.RELEASE</spring.version>
<spring-data.version>Kay-SR4</spring-data.version>
<spring-security.version>5.0.1.RELEASE</spring-security.version>
<spring-session.version>2.0.2.RELEASE</spring-session.version>
<reactor.version>Bismuth-SR9</reactor.version>
<spring.version>5.0.6.RELEASE</spring.version>
<spring-data.version>Kay-SR7</spring-data.version>
<spring-security.version>5.0.5.RELEASE</spring-security.version>
<spring-session.version>2.0.3.RELEASE</spring-session.version>
</properties>
<profiles>
@@ -89,10 +90,10 @@
<id>spring5-next</id>
<properties>
<reactor.version>Bismuth-BUILD-SNAPSHOT</reactor.version>
<spring.version>5.0.5.BUILD-SNAPSHOT</spring.version>
<spring.version>5.0.7.BUILD-SNAPSHOT</spring.version>
<spring-data.version>Kay-BUILD-SNAPSHOT</spring-data.version>
<spring-security.version>5.0.2.BUILD-SNAPSHOT</spring-security.version>
<spring-session.version>2.0.3.BUILD-SNAPSHOT</spring-session.version>
<spring-security.version>5.0.6.BUILD-SNAPSHOT</spring-security.version>
<spring-session.version>2.0.4.BUILD-SNAPSHOT</spring-session.version>
</properties>
<repositories>
<repository>
@@ -106,10 +107,12 @@
<id>springdata-next</id>
<properties>
<reactor.version>Bismuth-BUILD-SNAPSHOT</reactor.version>
<spring.version>5.0.5.BUILD-SNAPSHOT</spring.version>
<mongo.version>3.8.0-beta1</mongo.version>
<mongo-reactivestreams.version>1.8.0</mongo-reactivestreams.version>
<spring.version>5.0.7.BUILD-SNAPSHOT</spring.version>
<spring-data.version>Lovelace-BUILD-SNAPSHOT</spring-data.version>
<spring-security.version>5.0.1.RELEASE</spring-security.version>
<spring-session.version>2.0.3.BUILD-SNAPSHOT</spring-session.version>
<spring-security.version>5.0.5.RELEASE</spring-security.version>
<spring-session.version>2.0.4.BUILD-SNAPSHOT</spring-session.version>
</properties>
<repositories>
<repository>
@@ -433,6 +436,17 @@
</build>
</profile>
<profile>
<id>java10</id>
<activation>
<jdk>10</jdk>
</activation>
<properties>
<source.level>1.10</source.level>
</properties>
</profile>
</profiles>
<dependencyManagement>

View File

@@ -25,11 +25,10 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.PostConstruct;
import org.bson.Document;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
@@ -56,7 +55,7 @@ import com.mongodb.DBObject;
* @since 1.2
*/
public class MongoOperationsSessionRepository
implements FindByIndexNameSessionRepository<MongoSession>, ApplicationEventPublisherAware {
implements FindByIndexNameSessionRepository<MongoSession>, ApplicationEventPublisherAware, InitializingBean {
/**
* The default time period in seconds in which a session will expire.
@@ -162,8 +161,8 @@ public class MongoOperationsSessionRepository
});
}
@PostConstruct
public void ensureIndexesAreCreated() {
@Override
public void afterPropertiesSet() {
IndexOperations indexOperations = this.mongoOperations.indexOps(this.collectionName);
this.mongoSessionConverter.ensureIndexes(indexOperations);

View File

@@ -19,12 +19,11 @@ import static org.springframework.session.data.mongo.MongoSessionUtils.*;
import java.time.Duration;
import javax.annotation.PostConstruct;
import org.bson.Document;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import reactor.core.publisher.Mono;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
@@ -39,7 +38,7 @@ import org.springframework.session.events.SessionDeletedEvent;
* @author Greg Turnquist
*/
public class ReactiveMongoOperationsSessionRepository
implements ReactiveSessionRepository<MongoSession>, ApplicationEventPublisherAware {
implements ReactiveSessionRepository<MongoSession>, ApplicationEventPublisherAware, InitializingBean {
/**
* The default time period in seconds in which a session will expire.
@@ -147,8 +146,8 @@ public class ReactiveMongoOperationsSessionRepository
* Do not use {@link org.springframework.data.mongodb.core.index.ReactiveIndexOperations} to ensure indexes exist.
* Instead, get a blocking {@link IndexOperations} and use that instead, if possible.
*/
@PostConstruct
public void ensureIndexesAreCreated() {
@Override
public void afterPropertiesSet() {
if (this.blockingMongoOperations != null) {
IndexOperations indexOperations = this.blockingMongoOperations.indexOps(this.collectionName);

View File

@@ -206,7 +206,7 @@ public class ReactiveMongoOperationsSessionRepositoryTest {
this.repository.setBlockingMongoOperations(this.blockingMongoOperations);
// when
this.repository.ensureIndexesAreCreated();
this.repository.afterPropertiesSet();
// then
verify(this.blockingMongoOperations, times(1)).indexOps((String) any());