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 OverflowA 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.
It is possible that the parent pom has a dependencyManagement section that overwrites scopes/versions.
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.
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)