Student369
Student369

Reputation: 59

Hi, I have a problem creating a Spring with Reactor project with Maven

I'm tryng to do a tutorial about Reactor and WebFlux but when I tryng import the Mono dependency in my main class. the package don't exists.

import reactor.core.publisher.Mono;

the package publisher is marked in red in my editor.

The dependencies at pom.xml are:

<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
        <version>2.4.0</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.projectreactor/reactor-core -->
    <dependency>
        <groupId>org.projectreactor</groupId>
        <artifactId>reactor-core</artifactId>
        <version>1.1.6.RELEASE</version>
    </dependency>


    <!-- https://mvnrepository.com/artifact/io.reactivex.rxjava2/rxjava -->
    <dependency>
        <groupId>io.reactivex.rxjava2</groupId>
        <artifactId>rxjava</artifactId>
        <version>2.2.20</version>
    </dependency>


    <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <version>2.4.0</version>
        <scope>test</scope>
    </dependency>

Thanks by your help in advance.

Upvotes: 1

Views: 5485

Answers (1)

prost&#253; člověk
prost&#253; člověk

Reputation: 939

I think you are referring wrong artifact, please use the below one for Spring Webflux.

<dependency>
    <groupId>io.projectreactor</groupId>
    <artifactId>reactor-core</artifactId>
    <version>3.4.0</version>
</dependency>

Upvotes: 3

Related Questions