Run mvn spring-boot:run from parent module?

You can do it by adding following In parent pom: <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <skip>true</skip> </configuration> </plugin> </plugins> </build> And in your In my-app (Spring Boot module) pom: <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <fork>true</fork> <skip>false</skip> </configuration> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> Now you can do execute in project root: mvn -pl … Read more

How to set multiple headers at once in Spring WebClient?

If those headers change on a per request basis, you can use: webClient.get().uri(“/resource”).headers(httpHeaders -> { httpHeaders.setX(“”); httpHeaders.setY(“”); }); This doesn’t save much typing; so for the headers that don’t change from one request to another, you can set those as default headers while building the client: WebClient webClient = WebClient.builder().defaultHeader(“…”, “…”).build(); WebClient webClient = WebClient.builder().defaultHeaders(httpHeaders … Read more

Spring – Multiple Spring Data modules found, entering strict repository configuration mode

Sorry for answering too late, but I think answers that present already does not explain the actual, deep reason why is it happening. Let me explain everything in order to let you understand the guts (be ready, it will be quite long and comprehensive). If you are looking for simple solution, go to the bottom … Read more

Accessing the application properties in logback.xml

If you name your configuration file logback-spring.xml, rather than logback.xml, you can use <springProperty> to access properties from Spring’s environment including those configured in application.properties. This is described in the documentation: The tag allows you to surface properties from the Spring Environment for use within Logback. This can be useful if you want to access … Read more

What does ‘antMatchers’ mean?

It comes from Apache Ant Project, which is a java build system that utilises an xml scripting language. Here is the website Apache Ant Home and in Spring Doc for AntPathMatcher it says “Part of this mapping code has been kindly borrowed from Apache Ant.” So “antMatchers” means an implementation of Ant-style path patterns in … Read more

How to run Swagger 3 on Spring Boot 3

I had given up and went to use Spring Boot 2.7 after posting the question. But, after seeing Dmitriy’s answer though, I checked Springdoc one last time and found that Springdoc v2 does support Spring Boot 3. Essentially, one has to place the following in their pom: <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> <version>2.0.0</version> </dependency> Then one can … Read more

Compilation error after upgrading to JDK 21 – “NoSuchFieldError: JCImport does not have member field JCTree qualid”

The culprit is Lombok. The minimal Lombok version compatible with JDK 21 is 1.18.30. This implies that the minimal Spring Boot version is 3.1.4, unless you want to meddle with the Spring Boot autoconfiguration and set the Lombok version in your project differently from the Spring Boot BOM defined in spring-boot-dependencies. See: https://github.com/projectlombok/lombok/issues/3393

Spring Boot 3.x upgrade. Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.1

I see you’re using IntelliJ IDEA for this. This is what worked for me: Go to the settings –> Build, Execution, Deployment –> Build Tools –> Gradle. Click on your gradle project under ‘Gradle Projects’. Choose your Gradle JVM for the project… in my case it was openjdk-19. Now it should work.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)