title: Cannot connect to mongoDB using Spring Data Reactive and Spring Boot 2.0
body: <p>I get the following error every time I trying to connect to MongoDB using Spring Data Reactive and Spring Boot 2.0.</p>
  
  <pre><code>Caused by: java.lang.UnsupportedOperationException: No SSL support in java.nio.channels.AsynchronousSocketChannel. For SSL support use com.mongodb.connection.netty.NettyStreamFactoryFactory
          at com.mongodb.connection.AsynchronousSocketChannelStreamFactory.&lt;init&gt;(AsynchronousSocketChannelStreamFactory.java:41)
          at com.mongodb.async.client.MongoClients.getStreamFactory(MongoClients.java:228)
          at com.mongodb.async.client.MongoClients.create(MongoClients.java:177)
          at com.mongodb.async.client.MongoClients.create(MongoClients.java:123)
          at com.mongodb.reactivestreams.client.MongoClients.create(MongoClients.java:103)
          at com.mongodb.reactivestreams.client.MongoClients.create(MongoClients.java:53)
          at org.springframework.boot.autoconfigure.mongo.ReactiveMongoClientFactory.createNetworkMongoClient(ReactiveMongoClientFactory.java:123)
          at org.springframework.boot.autoconfigure.mongo.ReactiveMongoClientFactory.createMongoClient(ReactiveMongoClientFactory.java:69)
          at org.springframework.boot.autoconfigure.mongo.ReactiveMongoAutoConfiguration.reactiveStreamsMongoClient(ReactiveMongoAutoConfiguration.java:67)
          at org.springframework.boot.autoconfigure.mongo.ReactiveMongoAutoConfiguration$$EnhancerBySpringCGLIB$$94536095.CGLIB$reactiveStreamsMongoClient$1(&lt;generated&gt;)
          at org.springframework.boot.autoconfigure.mongo.ReactiveMongoAutoConfiguration$$EnhancerBySpringCGLIB$$94536095$$FastClassBySpringCGLIB$$2171f816.invoke(&lt;generated&gt;)
          at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
          at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358)
          at org.springframework.boot.autoconfigure.mongo.ReactiveMongoAutoConfiguration$$EnhancerBySpringCGLIB$$94536095.reactiveStreamsMongoClient(&lt;generated&gt;)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
          at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:587)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1246)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1093)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:534)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:491)
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
          at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:250)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1128)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1056)
          at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:833)
          at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:740)
          at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:466)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1246)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1093)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:534)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:491)
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
          at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:250)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1128)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1056)
          at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:833)
          at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:740)
          at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:466)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1246)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1093)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:534)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:491)
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1604)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1349)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:574)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:491)
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
          at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:250)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1128)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1056)
          at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:570)
          at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
          at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:358)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1337)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:574)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:491)
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:751)
          at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:865)
          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
          at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:809)
          at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:404)
          at org.springframework.boot.SpringApplication.run(SpringApplication.java:347)
          at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:128)
          at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
          at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
          at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:102)
          at org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance(SpringBootDependencyInjectionTestExecutionListener.java:47)
          at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:243)
          at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:226)
          at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288)
          at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
          at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:290)
          at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:245)
          at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
          at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
          at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
          at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
          at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
          at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
          at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
          at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
          at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
          at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:189)
          at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
          at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
          at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
          at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
          at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
          at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
          at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
  </code></pre>
  
  <p>The error message tells me to use NettyStreamFactoryFactory for SSL support.  Does anyone have any examples on how to do this? The database I am trying to connect to is MongoDB Atlas, it strictly require a SSL connection.</p>
  
  <p>Below is the rest of my code:</p>
  
  <pre><code>@SpringBootApplication
  public class FlixMovieApiReactiveApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(FlixMovieApiReactiveApplication.class, args);
      }
  
      // Add Data
      @Bean
      public CommandLineRunner initDatabase(MovieRepository repository) {
  
          // entire process blocking, done in beginning
          Flux&lt;Movie&gt; movieList = Flux.just(
                  new Movie("movie1", "1", "movie1"),
                  new Movie("movie2", "1", "movie2"),
                  new Movie("movie3", "5", "movie3"),
                  new Movie("movie4", "1", "movie4"),
                  new Movie("movie5", "3", "movie5"),
                  new Movie("movie6", "1", "movie6"),
                  new Movie("movie7", "2", "movie7"),
                  new Movie("movie8", "3", "movie8"),
                  new Movie("movie9", "1", "movie9"),
                  new Movie("movie10", "2", "movie10"),
                  new Movie("movie11", "1", "movie11"),
                  new Movie("movie12", "3", "movie12"),
                  new Movie("movie13", "1", "movie13"),
                  new Movie("movie14", "4", "movie14"),
                  new Movie("movie15", "1", "movie15"),
                  new Movie("movie16", "4", "movie16")
          );
  
          // delete then insert data.  blockLast(), allows something to subscribe to pipeline, block for last emitted element
          // data is written to the database.
          return args -&gt; repository.deleteAll().thenMany(repository.save(movieList)).blockLast();
      }
  }
  
  @RestController
  public class MovieRestController {
  
      @Autowired
      private MovieService movieService;
  
      @GetMapping(value = "/movies")
      public Flux&lt;ResponseEntity&lt;Movie&gt;&gt; list() {
  
          return movieService.list().map(m -&gt; new ResponseEntity&lt;&gt;(m, HttpStatus.OK));
      }
  
      @GetMapping(value = "/moviesByRating")
      public Flux&lt;ResponseEntity&lt;Movie&gt;&gt; findByRating(
              @RequestParam(value = "rating", required = false) final String rating) {
  
          return movieService.findByRating(rating)
                  .map(m -&gt; new ResponseEntity&lt;&gt;(m, HttpStatus.OK));
  
      }
  
      @GetMapping("/movies/{movieId}")
      public Mono&lt;ResponseEntity&lt;Movie&gt;&gt; read(
              @PathVariable("movieId") final String movieId) {
  
          return movieService.read(movieId)
                  .map(m -&gt; new ResponseEntity&lt;&gt;(m, HttpStatus.OK))
                  .defaultIfEmpty(new ResponseEntity&lt;&gt;(HttpStatus.NOT_FOUND));
      }
  
      @DeleteMapping("/movies/{movieId}")
      public Mono&lt;ResponseEntity&lt;Movie&gt;&gt; delete(
              @PathVariable("movieId") final String movieId) {
  
          return movieService.delete(movieId)
                  .map(m -&gt; new ResponseEntity&lt;&gt;(m, HttpStatus.OK))
                  .defaultIfEmpty(new ResponseEntity&lt;&gt;(HttpStatus.NOT_FOUND));
      }
  
      @PutMapping("/movies/{movieId}")
      public Mono&lt;ResponseEntity&lt;Movie&gt;&gt; update(
              @PathVariable("movieId") final String movieId,
              @RequestBody final MovieRequest movieRequest) {
  
          return movieService.update(movieId, movieRequest)
                  .map(m -&gt; new ResponseEntity&lt;&gt;(m, HttpStatus.OK))
                  .defaultIfEmpty(new ResponseEntity&lt;&gt;(HttpStatus.NOT_FOUND));
  
      }
  
      @PostMapping("/movies")
      public Mono&lt;ResponseEntity&lt;Movie&gt;&gt; create(
              @RequestBody final Mono&lt;MovieRequest&gt; movieRequest) {
  
          return movieService.create(movieRequest)
                  .map(m -&gt; new ResponseEntity&lt;&gt;(m, HttpStatus.OK))
                  .defaultIfEmpty(new ResponseEntity&lt;&gt;(HttpStatus.NOT_FOUND));
  
      }
  
  }
  
  @Service
  public class MovieServiceImpl implements MovieService {
  
      @Autowired
      private MovieRepository movieRepository;
  
      @Override
      public Flux&lt;Movie&gt; list(){
          return movieRepository.findAll();
      }
  
      @Override
      public Flux&lt;Movie&gt; findByRating(final String rating){
          return movieRepository.findByRating(rating);
      }
  
      @Override
      public Mono&lt;Movie&gt; update(String id, MovieRequest movieRequest) {
  
         return movieRepository.findOne(id).map(existingMovie -&gt; {
  
             if(movieRequest.getDescription() != null){
                 existingMovie.setDescription(movieRequest.getDescription());
             }
             if(movieRequest.getRating() != null){
                 existingMovie.setRating(movieRequest.getRating());
             }
             if(movieRequest.getTitle() != null) {
                 existingMovie.setTitle(movieRequest.getTitle());
             }
  
             return existingMovie;
  
         }).then(movieRepository::save);
      }
  
      @Override
      public Mono&lt;Movie&gt; create(Mono&lt;MovieRequest&gt; movieRequest) {
  
          return movieRequest.map(newMovie -&gt; {
  
              Movie movie = new Movie();
  
              if(newMovie.getDescription() != null){
                  movie.setDescription(newMovie.getDescription());
              }
              if(newMovie.getRating() != null){
                  movie.setRating(newMovie.getRating());
              }
              if(newMovie.getTitle() != null) {
                  movie.setTitle(newMovie.getTitle());
              }
  
              return movie;
  
          }).then(movieRepository::save);
      }
  
      @Override
      public Mono&lt;Movie&gt; read(String id) {
          return movieRepository.findOne(id);
      }
  
      @Override
      public Mono&lt;Movie&gt; delete(String id) {
          return movieRepository.findOne(id)
                  .flatMap(oldValue -&gt; movieRepository.delete(id).then(Mono.just(oldValue)))
                  .singleOrEmpty();
      }
  }
  
  @Repository
  public interface MovieRepository extends ReactiveMongoRepository&lt;Movie, String&gt; {
  
      Flux&lt;Movie&gt; findByRating(String rating);
  }
  
  @Document
  public class Movie {
  
      @Id
      private String id;
      private String title;
      private String rating;
      private String description;
  
      public Movie(String title, String rating, String description) {
          this.title = title;
          this.rating = rating;
          this.description = description;
      }
  
      public Movie() {
      }
  
  
      public String getId() {
          return id;
      }
  
      public void setId(String id) {
          this.id = id;
      }
  
      public String getTitle() {
          return title;
      }
  
      public void setTitle(String title) {
          this.title = title;
      }
  
      public String getRating() {
          return rating;
      }
  
      public void setRating(String rating) {
          this.rating = rating;
      }
  
      public String getDescription() {
          return description;
      }
  
      public void setDescription(String description) {
          this.description = description;
      }
  }
  
  ---
  
  spring:
      data:
          mongodb:
            uri: mongodb://admin:xxxxxx@movie-shard-00-00-xfzg4.mongodb.net:27017,movie-shard-00-01-xfzg4.mongodb.net:27017,movie-shard-00-02-xfzg4.mongodb.net:27017/movie?ssl=true&amp;replicaSet=Movie-shard-0&amp;authSource=admin
  
  management:
    context-path: /admin
  
  server:
    port: 8080
  </code></pre>
  
  <p>Below is the pom.xml file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.flix.movie&lt;/groupId&gt;
      &lt;artifactId&gt;flix-movie-api-reactive&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;name&gt;flix-movie-api-reactive&lt;/name&gt;
      &lt;description&gt;Demo project for Spring Boot using Non-Blocking Reactive Spring Web MVC and Spring Data MongoDB&lt;/description&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.0.0.BUILD-SNAPSHOT&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
          &lt;docker.image.prefix&gt;flix&lt;/docker.image.prefix&gt;
          &lt;docker.spotify.plugin.version&gt;0.4.5&lt;/docker.spotify.plugin.version&gt;
          &lt;swagger.version&gt;2.4.0&lt;/swagger.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-mongodb-reactive&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-webflux&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.springfox&lt;/groupId&gt;
              &lt;artifactId&gt;springfox-swagger2&lt;/artifactId&gt;
              &lt;version&gt;${swagger.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.springfox&lt;/groupId&gt;
              &lt;artifactId&gt;springfox-swagger-ui&lt;/artifactId&gt;
              &lt;version&gt;${swagger.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.boot.experimental&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-dependencies-web-reactive&lt;/artifactId&gt;
                  &lt;version&gt;0.1.0.BUILD-SNAPSHOT&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
              &lt;!-- Package as a docker image --&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;com.spotify&lt;/groupId&gt;
                  &lt;artifactId&gt;docker-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${docker.spotify.plugin.version}&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;serverId&gt;docker-hub&lt;/serverId&gt;
                      &lt;imageName&gt;${docker.image.prefix}/${project.artifactId}&lt;/imageName&gt;
                      &lt;dockerDirectory&gt;src/main/docker&lt;/dockerDirectory&gt;
                      &lt;resources&gt;
                          &lt;resource&gt;
                              &lt;targetPath&gt;/&lt;/targetPath&gt;
                              &lt;directory&gt;${project.build.directory}&lt;/directory&gt;
                              &lt;include&gt;${project.build.finalName}.jar&lt;/include&gt;
                          &lt;/resource&gt;
                      &lt;/resources&gt;
                      &lt;imageTags&gt;
                          &lt;imageTag&gt;${project.version}&lt;/imageTag&gt;
                      &lt;/imageTags&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;spring-snapshots&lt;/id&gt;
              &lt;name&gt;Spring Snapshots&lt;/name&gt;
              &lt;url&gt;https://repo.spring.io/snapshot&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
              &lt;id&gt;spring-milestones&lt;/id&gt;
              &lt;name&gt;Spring Milestones&lt;/name&gt;
              &lt;url&gt;https://repo.spring.io/milestone&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
      &lt;pluginRepositories&gt;
          &lt;pluginRepository&gt;
              &lt;id&gt;spring-snapshots&lt;/id&gt;
              &lt;name&gt;Spring Snapshots&lt;/name&gt;
              &lt;url&gt;https://repo.spring.io/snapshot&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/pluginRepository&gt;
          &lt;pluginRepository&gt;
              &lt;id&gt;spring-milestones&lt;/id&gt;
              &lt;name&gt;Spring Milestones&lt;/name&gt;
              &lt;url&gt;https://repo.spring.io/milestone&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/pluginRepository&gt;
      &lt;/pluginRepositories&gt;
  
  &lt;/project&gt;
  </code></pre>