I’ve seen you’ve gone the stretch and not only created a user group issue, but also a StackOverflow question and a GitHub issue.
To keep things simple for me, I will copy over my answer I gave on StackOverflow and on the GitHub issue:
So, this took my some investigation to get a hunch what is going wrong, but I know what the problem is.
Quick notice, it’s not an Axon specific thing, rather the plugin you are using.
I ran your sample project and indeed ended up with the same result; no Axon beans were being wired, ever. That led me to investigate the process of creating fat JAR’s step by step. First Maven, then Spring Boot with Maven, then Gradle with Spring Boot and finally with the Shadow plugin you are referring too.
This endeavour landed me on this issue, which states as much as “projects which require the use of META-INF files need to add this to the shadow plugin, and this should be documented”.
The portion referenced through this is the following:
// Left out all other specifics from your 'build.gradle' file
// Required for Spring
paths = ['META-INF/spring.factories' ]
mergeStrategy = "append"
getDestinationDirectory().set(new File(projectDir, "./build"))
After adding that piece of logic to your
build.gradle file, I could run your sample project as expected.
Trusting this will help you out Andrey, and potentially others using the plugin too.
Steven van Beelen
Axon Framework Lead Developer