The real issue is here in this comment : https://github.com/spring-cloud/spring-cloud-kubernetes/pull/1677#issuecomment-2247696250
I will try to simplify this as much as possible in order for you to re-produce it. Simply clone this repository : https://github.com/wind57/spring-maven-sources-plugin-issue/tree/main
and issue a mvn clean install. It will fail with a :
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-source-plugin:3.3.1:jar (attach-sources) on project demo: Presumably you have configured maven-source-plugin to execute twice in your build. You have to configure a classifier for at least one of them. -> [Help 1]
The cause of this issue is in that comment in the spring-cloud-kubernetes project. If there is anything else required from me, will be more then glad to provide. Thank you
Comment From: snicoll
This is documented. If you bind the goal this way you must use build-image-no-fork to avoid forking the lifecycle. It has nothing to do with Spring Boot, it's just common practice in Maven land (you'll notice that the source plugin also has a no-fork goal).
I've changed the goal in your sample from build-image to build-image-no-forkand it worked (once I added the missing snapshot and milestone repositories).
Comment From: wind57
ah! thank you for the answer and sorry for the noise!