Hi According to the docs, this plugin is meant to execute on the process-classes phase. However this phase executes after the compile phase so the autogenerated class never gets compiled.
If you subsequently run the maven execution again, the compiler picks it up the second time around. Unit tests that rely on the generated class will always fail the first time and pass on the second. Compounding the issue is that the default output directory is src/generated which does not get cleaned up when running "mvn clean". If you add this directory to be cleaned up by maven-clean-plugin then you can consistently reproduce this bug. IMO, camel should be defaulting to generating sources in the target directory so it would get cleaned up by default. I have attempted to change the phase that camel-component-maven-plugin gets executed but no classes seem to get generated at all. I tried generate-sources and compile phase, neither worked. This bug pretty much prevents any correct builds happening in the cloud (like Bitbucket/Azure pipelines) as everything starts from scratch. If you have unit tests that rely on it, the build will fail. If you don't have unit tests, then you end up with a jar missing the autogenerated class in it. I am using Camel 3.15.0 and JDK 11