A Spring Boot fat jar is intended to contain everything that's required to run the application. You can't use -jar and -classpath at the same time when launching the JVM, so that means that the jar needs to contain provided dependencies as well as there's no other way for them to get onto the classpath.

This behaviour is described in the documentation for Spring Boot's Maven Plugin where it says the following:

The example above repackages a jar or war that is built during the package phase of the Maven lifecycle, including any provided dependencies that are defined in the project.

If you don't want your application's jar to have any dependencies packaged inside it, i.e. you want it to be a normal jar rather than a fat jar, then you probably do not want to use Spring Boot's Maven plugin to build it. If you remove it from your sample project's pom.xml file and then build it, the resulting jar has the following contents:

$ unzip -l target/MavenProvidedTest-0.0.1-SNAPSHOT.jar 
Archive:  target/MavenProvidedTest-0.0.1-SNAPSHOT.jar
  Length      Date    Time    Name
---------  ---------- -----   ----
      329  02-22-2019 11:33   META-INF/MANIFEST.MF
        0  02-22-2019 11:33   META-INF/
        0  02-22-2019 11:33   META-INF/maven/
        0  02-22-2019 11:33   META-INF/maven/io.spring/
        0  02-22-2019 11:33   META-INF/maven/io.spring/MavenProvidedTest/
        1  02-22-2019 11:33   application.properties
     1403  02-22-2019 11:33   META-INF/maven/io.spring/MavenProvidedTest/pom.xml
      101  02-22-2019 11:33   META-INF/maven/io.spring/MavenProvidedTest/pom.properties
---------                     -------
     1834                     8 files

If you want some but not all of the dependencies to be included, then you could continue to use Spring Boot's Maven Plugin and exclude some dependencies instead.

Answer from Andy Wilkinson on Stack Overflow
🌐
Maven Central
central.sonatype.com › artifact › org.springframework.boot › spring-boot-starter-webflux
Maven Central: org.springframework.boot:spring-boot-starter-webflux
pkg:maven/org.springframework.boot/spring-boot-starter-webflux@Loading... ... <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webflux</artifactId> <version>4.2.0-M2</version> </dependency>
🌐
Maven Repository
mvnrepository.com › artifact › org.springframework.boot › spring-boot-starter-webflux
Maven Repository: org.springframework.boot » spring-boot-starter-webflux
August 20, 2026 - Maven Plugins · Testing · Language Runtime · Android Packages · JVM Languages · Logging Frameworks · JSON Libraries · Java Specifications · Core Utilities · Annotation Libraries · Web Assets · Mocking · HTTP Clients · Concurrency Libraries · Logging Bridges · Dependency Injection · XML Processing · Web Frameworks · I/O Utilities · Code Generators · View All · Home » org.springframework.boot » spring-boot-starter-webflux ·
Top answer
1 of 3
3

A Spring Boot fat jar is intended to contain everything that's required to run the application. You can't use -jar and -classpath at the same time when launching the JVM, so that means that the jar needs to contain provided dependencies as well as there's no other way for them to get onto the classpath.

This behaviour is described in the documentation for Spring Boot's Maven Plugin where it says the following:

The example above repackages a jar or war that is built during the package phase of the Maven lifecycle, including any provided dependencies that are defined in the project.

If you don't want your application's jar to have any dependencies packaged inside it, i.e. you want it to be a normal jar rather than a fat jar, then you probably do not want to use Spring Boot's Maven plugin to build it. If you remove it from your sample project's pom.xml file and then build it, the resulting jar has the following contents:

$ unzip -l target/MavenProvidedTest-0.0.1-SNAPSHOT.jar 
Archive:  target/MavenProvidedTest-0.0.1-SNAPSHOT.jar
  Length      Date    Time    Name
---------  ---------- -----   ----
      329  02-22-2019 11:33   META-INF/MANIFEST.MF
        0  02-22-2019 11:33   META-INF/
        0  02-22-2019 11:33   META-INF/maven/
        0  02-22-2019 11:33   META-INF/maven/io.spring/
        0  02-22-2019 11:33   META-INF/maven/io.spring/MavenProvidedTest/
        1  02-22-2019 11:33   application.properties
     1403  02-22-2019 11:33   META-INF/maven/io.spring/MavenProvidedTest/pom.xml
      101  02-22-2019 11:33   META-INF/maven/io.spring/MavenProvidedTest/pom.properties
---------                     -------
     1834                     8 files

If you want some but not all of the dependencies to be included, then you could continue to use Spring Boot's Maven Plugin and exclude some dependencies instead.

2 of 3
1

It is possible that the parent pom has a dependencyManagement section that overwrites scopes/versions.

🌐
Maven Central Repository
search.maven.org › org.springframework.boot › spring-boot-starter-webflux › 2.5.0
Maven Central: org.springframework.boot:spring-boot-starter-webflux:2.5.0
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webflux</artifactId> <version>2.5.0</version> </dependency>
🌐
Maven Repository
mvnrepository.com › artifact › org.springframework › spring-webflux
Maven Repository: org.springframework » spring-webflux
August 20, 2026 - Spring Boot Starters · Maven Plugins · Testing · Language Runtime · Android Packages · JVM Languages · Logging Frameworks · JSON Libraries · Java Specifications · Core Utilities · Annotation Libraries · Web Assets · Mocking · HTTP Clients · Concurrency Libraries · Logging Bridges · Dependency Injection · XML Processing · Web Frameworks · I/O Utilities · Code Generators · View All · Home » org.springframework » spring-webflux ·
🌐
Red Hat
access.redhat.com › solutions › 6973850
Could not use spring-boot-starter-webflux maven dependency while using Fuse v7.11 BOM. - Red Hat Customer Portal
Fuse application build failure with the below error message [ERROR] Failed to execute goal on project : Could not resolve dependencies for project nz.co.spark.intg.ms.posmgmt:pos-manage-v1:jar:1.0.0: Failure to find io.netty:netty-resolver-dns-native-macos:jar:osx-x86_64:4.1.74.Final-redhat-00001
🌐
Maven Central
central.sonatype.com › artifact › org.springframework.boot › spring-boot-starter-webflux › 2.1.7.RELEASE
spring-boot-starter-webflux - Maven Central - Sonatype
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webflux</artifactId> <version>2.1.7.RELEASE</version> </dependency> Copy to clipboard · <?xml version="1.0" encoding="UTF-8"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starters</artifactId> <version>2.1.7.RELEASE</version> </parent> <
Find elsewhere
🌐
Stack Overflow
stackoverflow.com › questions › 63737318 › why-does-spring-boot-starter-webflux-import-spring-web
Why does spring-boot-starter-webflux import spring-web? - Stack Overflow
Well, mvn dependency:tree gives me the anwser: [INFO] +- org.springframework.boot:spring-boot-starter-webflux:jar:2.1.8.RELEASE:compile [INFO] | +- org.springframework:spring-web:jar:5.1.9.RELEASE:compile [INFO] | \- org.springframework:spring-webflux:jar:5.1.9.RELEA4SE:compile
🌐
Maven Central
central.sonatype.com › artifact › org.springframework.boot › spring-boot-starter-webflux › 2.5.0
org.springframework.boot:spring-boot-starter-webflux:2.5.0
pkg:maven/org.springframework.boot/spring-boot-starter-webflux@2.5.0 ... <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webflux</artifactId> <version>2.5.0</version> </dependency>
🌐
Maven Central Repository
search.maven.org › org.springframework.boot › spring-boot-starter-webflux › 2.5.5
org.springframework.boot:spring-boot-starter-webflux:2.5.5
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webflux</artifactId> <version>2.5.5</version> </dependency>
🌐
Baeldung
baeldung.com › home › spring › spring webflux › guide to spring webflux
Guide to Spring WebFlux | Baeldung
November 24, 2025 - <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webflux</artifactId> <version>3.5.7</version> </dependency> The latest spring-boot-starter-webflux can be downloaded from Maven Central.
🌐
josdem
josdem.io › home › getting started with spring webflux
Getting Started with Spring Webflux -
July 25, 2024 - plugins { id 'java' id 'org.springframework.boot' version '3.0.6' id 'io.spring.dependency-management' version '1.1.0' } group = 'com.jos.dem.webflux' version = '0.0.1-SNAPSHOT' sourceCompatibility = 17 configurations { compileOnly { extendsFrom annotationProcessor } } repositories { mavenCentral() } dependencies { implementation('org.springframework.boot:spring-boot-starter-webflux') compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' implementation('org.springframework.boot:spring-boot-starter-data-mongodb-reactive') testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'io.projectreactor:reactor-test' } tasks.named('test') { useJUnitPlatform() }
🌐
DigitalOcean
digitalocean.com › community › tutorials › spring-webflux-reactive-programming
Spring WebFlux - Spring Reactive Programming | DigitalOcean
August 4, 2022 - But Spring Boot will configure our application as Spring WebFlux since we have added dependency of spring-boot-starter-webflux module.
🌐
Stack Overflow
stackoverflow.com › questions › 79434697 › org-springframework-bootspring-boot-starter-webflux3-4-2-has-different-version
java - org.springframework.boot:spring-boot-starter-webflux:3.4.2 has different versions of io.netty - Stack Overflow
Here's a snippet from the maven dependency tree for Project "1": [INFO] +- org.springframework.boot:spring-boot-starter-webflux:jar:3.4.2:compile [INFO] | +- (org.springframework.boot:spring-boot-starter:jar:3.4.2:compile - version managed from 3.4.2; omitted for duplicate) [INFO] | +- (org.springframework.boot:spring-boot-starter-json:jar:3.4.2:compile - version managed from 3.4.2; omitted for duplicate) [INFO] | +- org.springframework.boot:spring-boot-starter-reactor-netty:jar:3.4.2:compile (version managed from 3.4.2) [INFO] | | \- io.projectreactor.netty:reactor-netty-http:jar:1.2.2:compil
Top answer
1 of 2
44

As explained in the Spring Boot reference documentation section about the web environment, adding both web and webflux starters will configure a Spring MVC web application.

This is behaving like that, because many existing Spring Boot web applications (using MVC) will depend on the webflux starter to use the WebClient. Spring MVC partially support reactive return types, so this is an expected use case. The opposite isn't really true, since a reactive application is not really likely to use Spring MVC bits.

So using both web and webflux starters is supported, but it will configure a Spring MVC application. You can always force the Spring Boot application to be reactive with:

SpringApplication.setWebApplicationType(WebApplicationType.REACTIVE)

But it's still a good idea to clean up dependencies as it would be easy to use a blocking feature in your reactive web application.

2 of 2
-1

I had a similar issue using spring-boot-starter-webflux and spring-data-geode causing

DEBUG [http-nio-8082-exec-2] org.sprin.web.servl.resou.ResourceHttpRequestHandler 454 handleRequest: Resource not found

It was resolved by changing the application type

@SpringBootApplication
public class Web {
    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(Web.class);
        app.setWebApplicationType(WebApplicationType.REACTIVE);
        SpringApplication.run(Web.class, args);
    }
}

The whole class used to look like this

After setting the application type, if I don't then call the SpringApplication in a static way, I get this:

So it's changed to app.run(args)

🌐
Spring
docs.spring.io › spring-security › reference › reactive › getting-started.html
Getting Started with WebFlux Applications :: Spring Security
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> implementation 'org.springframework.boot:spring-boot-starter-security' You can now run the Spring Boot application by using the Maven Plugin’s run goal.
🌐
NashTech Blog
blog.nashtechglobal.com › home › introduction to spring webflux
Introduction to Spring WebFlux - NashTech Blog
July 27, 2022 - It is mainly used for backend communication. maven Dependency: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webflux</artifactId> </dependency> Gradle dependency: dependencies { compile 'org.spring...