CodexBloom - Programming Q&A Platform

Maven plugin execution scenarios with NoSuchMethodError on Java 11 when using Spring Boot Starter

πŸ‘€ Views: 482 πŸ’¬ Answers: 1 πŸ“… Created: 2025-07-06
maven spring-boot java-11 Java

Could someone explain I've searched everywhere and can't find a clear answer. I'm working with a `NoSuchMethodError` when building my Spring Boot application using Maven after upgrading to Java 11. The behavior specifically mentions that it want to find a method in a class from the `spring-boot-starter-web` dependency. Here’s the stack trace I’m seeing: ``` Exception in thread "main" java.lang.NoSuchMethodError: 'void org.springframework.http.converter.json.MappingJackson2HttpMessageConverter.setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)' ``` I have confirmed that I am using Spring Boot version 2.5.4 and my `pom.xml` looks like this: ```xml <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"> <modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId> <artifactId>demo</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <properties> <java.version>11</java.version> <spring-boot.version>2.5.4</spring-boot.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <version>${spring-boot.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.12.3</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>${spring-boot.version}</version> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project> ``` I've tried cleaning the project with `mvn clean` and rebuilding it with `mvn package`, but the scenario continues. I also removed the `.m2/repository` folder to force Maven to re-download the dependencies, yet I still encounter the same behavior. It seems like a compatibility scenario with Jackson, but I would expect Spring Boot to manage those dependencies correctly. Has anyone faced a similar scenario, or can you suggest what I might be missing here? Thanks in advance! I'm on Linux using the latest version of Java. Thanks in advance!