Add compiler options when spring-boot-maven-plugin is used - spring-boot

I want to use the jackson module parameter-names with Java 8 in my spring boot application. I need to provide the option "-parameters" to the compiler. Could you please let me know how to do this in pom.xml for the spring boot plug-in spring-boot-maven-plugin.
I found only following answer (How to compile Spring Boot applications with Java 8 --parameter flag), but the answer refers to different plug-in.
Thanks.

Spring Boot relies on maven-compiler-plugin. Check Spring Boot parent pom. Or check my answer here

Related

Selenium 4.1 and Spring boot Web driver version issue

I tried to migrate gradle project with spring boot from selenium 3 to selenium 4
(implementation 'org.seleniumhq.selenium:selenium-java:4.1.1')
But chrome, firefox and edge web drivers remains from selenium version 3
(org.seleniumhq.selenium:selenium-chrome-driver:3.141.59).
If I remove spring boot dependency from project, they updates to 4.1.1
Currently using gradle version "7.3.3".
Spring boot "2.6.3".
Spring dependency management "1.0.11.RELEASE".
Any ideas why this happens, I hoped that dependency hell dissapeared with spring boot creation)
Thanks in advance!
I have the same promble, I found in spring-boot-starter-parent, there is a spring-boot-dependencies in ~/.m2/repository/org/springframework/boot/spring-boot-dependencies/2.6.3/spring-boot-dependencies-2.6.3.pom, which declared <selenium.version>3.141.59</selenium.version> in properties, so you can try add
<properties>
<selenium.version>4.1.2</selenium.version>
</properties>
in your project pom.xml.
Spring Boot comes with a set of versions that are know to work together. But you can override them in your build script. In case of Gradle, add to build.gradle:
ext['selenium.version'] = '4.1.2'
It is because Spring Boot comes packed with a set of predefined dependecies that you can find here: https://docs.spring.io/spring-boot/docs/2.6.7/reference/htmlsingle/#appendix.dependency-versions
In this page, you will also find, how to change predefined version. In general, you need to add .version to your dependency name and, in case of multiple word names, you change spaces to dashes (not needed in case of selenium).
So, to change version to most recent, type in build.gradle ext['selenium.version'] = '4.4.0' at 0 indent level. (don't add it, say inside dependencies {})

Which dependency should be used to integrate Apache Camel with Spring Boot

Apache Camel provides two ways to integrate with Spring Boot:
camel-spring-boot
camel-spring-boot-starter
When I look at the starter then I see that it only includes camel-spring-boot and spring-boot-starter. What is the difference then and what are the advantages of using starter?
At the moment of writing this answer, camel-spring-boot is only supported from Camel 2.15 and camel-spring-boot-starter only from Camel 2.17, which is important considering the current version that your project is using.
Then the major difference between these two dependencies, lies in the "opinionated" auto-configuration provided by the starter.
camel-spring-boot, should be used if you want just to include a jar to make your camel routes auto-discovered by spring boot, this also gives you the freedom to update this dependency regardless of your spring-boot version.
camel-spring-boot-starter, (recommended way to go) should be used if you want a collection of dependencies (including camel-spring-boot) that provides the best developer/user experience, due to the fact of customizable properties, additional libraries, and default configuration for the camel library. Check the reference documentation for the starter: https://camel.apache.org/components/latest/spring-boot.html#_spring_boot_auto_configuration
Summary
Use camel-spring-boot, if you want a vanilla jar to use camel with spring boot
Use camel-spring-boot-starter, if you want an automatic-configured component to start to develop with.
You should always use the camel-xxx-starter dependencies, as these are the Camel components that is support with Spring Boot. Also as mentioned they provide auto configuration and some of them additional capabilities.
If there is no camel-xxx-starter component then its because its not supported on Spring Boot with Camel.
See more at: https://github.com/apache/camel/tree/master/platforms/spring-boot/components-starter#camel-component-starters

Why are there no Java classes in Spring Boot starters JARs?

On springboot 2.0 I want to know why spring authorities do this?
spring-boot-starter-jdbc-2.0.0.jar why not content????
This is done on purpose.
The code for the auto-configuration is contained in the spring-boot module; Spring Boot starters are "just" POMs bringing all the dependencies that will trigger the auto-configuration for that use case.
Third party starters (i.e. maintained by the community) can ship auto-configuration code as well.
You can learn more about how to create your own starter and why they're structured like this in the reference documentation.

Spring Boot support maven multi-module

I am trying to convert my existing multi-module maven Spring project to Spring Boot project. The reason is make it self contain and follow Martain Fowler's microservices concept.
However, the problem I have encounter is when try to clean build, seems the spring boot is trying to find the Main method from every module, which of course will failed.
Is this feature currently supported by Spring Boot 1.1.6.RELEASE or I did something wrong?
Thanks
It sounds like you've added Spring Boot's Maven plugin to every module in your build – it's what's looking for a main method. You should only add the Spring Boot plugin to a module if its a service that you want to run. If the module's just code that's shared between your services, the Spring Boot plugin isn't needed in that module.

How to add email to Spring Boot gradle build

Spring boot has a number of starter dependencies. The default set does not include support for mail (org.springframework.mail is missing in Boot). How do I configure my build.gradle to include the spring framework mail support?
For spring boot you want to use this:
compile("org.springframework.boot:spring-boot-starter-mail")
See more about spring starters here
Try spring-context-support, ie
compile 'org.springframework:spring-context-support'
You might find this a helpful tool for that kind of query: http://www.findjar.com.

Resources