Open fabapp2 opened 2 years ago
@fabapp2 - would like to try creating a new recipe. Maybe I can pick this one to get started?
Great, thanks! 🚀 Happily assigned-to: @ahmedmq
The description is rather minimal, don't hesitate to pull all information you need.
Hey @fabapp2 : Just wanted to share my understanding of the changes required . Could you let me know of anything i have missed
Recipe:
Create new recipe using YML configuration possibly under sbm-support-boot
module
Conditions:
HasDecalredSpringBootStarterParent
maven-compiler-plugin
exists with only source
and target
under configurationAction:
maven-compiler-plugin
plugin using RemovePluginsMatchingRegex
Also, I was not sure about replacing the Java properties and what is to be done. Spring boot parent already defines these properties:
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
Hi @ahmedmq, thanks for your analysis!
Your observations are all correct for my understanding.
I can see the recipe doing two things:
. Always clean up properties . When no additional configuration is provided, remove the plugin
target
and source version
differ, do nothingOtherwise
maven.compiler.source
and maven.compiler.target
should be retrieved from parentjava.version
maven-compiler-plugin
should be replaced with maven.compiler.*
java.version
maven.compiler.*
properties set through java.version
PlatUML code: gh428.puml.txt
It's probably a good idea to have two Action
s, one cleaning up the properties and one actually removing the plugin.
This would allow us to use them separately (in two recipes) when needed.
Your thoughts on this?
I think i get it. Let me start and I will reach out if I get stuck
What needs to be done
Provide a recipe
remove-redundant-maven-compiler-plugin
that removes redundantmaven-compiler-plugin
configurations in Spring Boot applications that have a spring-boot parent where the compiler-plugin is managed.Why it needs to be done
Cleaner pom.xml by using Spring Boot's plugin management
Acceptance Criteria
Given: A pom.xml with direct or indirect spring-boot-starter-parent and a standard
maven-compiler-plugin
configuration with onlysource
andtarget
When:remove-redundant-maven-compiler-plugin
is applied Then: Themaven-compiler-plugin
is removed and Properties defining the java version are replaced withjava.version
property used by boot.Additional Information