Hi Yeah lets add this to the docs https://issues.apache.org/jira/browse/CAMEL-17903
On Tue, Mar 29, 2022 at 11:18 AM Minh Tran <minh.tran...@gmail.com> wrote: > > This workaround does the job. Thank you Claus. > > On Mon, 28 Mar 2022 at 23:16, Claus Ibsen <claus.ib...@gmail.com> wrote: > > > It is a plugin to assist when building custom camel components, not to > > use for end user applications. > > > > It is currently two-step as I said. Its not an easy fix. > > > > In the camel project we have a re-compile step > > > > <plugin> > > <artifactId>maven-compiler-plugin</artifactId> > > <executions> > > <execution> > > <id>recompile</id> > > <goals> > > <goal>compile</goal> > > </goals> > > <phase>process-classes</phase> > > </execution> > > </executions> > > </plugin> > > > > > > On Mon, Mar 28, 2022 at 1:39 PM Minh Tran <minh.tran...@gmail.com> wrote: > > > > > > Are you suggesting we should really be executing the build like this? > > > > > > mvn clean process-classes test > > > > > > It works I guess but highly unconventional compared to other maven code > > > generation plugins. It could also potentially be a big overhead as you're > > > running the all the phases prior to process-classes twice. > > > > > > Wouldn't the simplest solution be to fix the plugin to allow generating > > the > > > source during the generate-sources phase? > > > > > > On Mon, 28 Mar 2022 at 21:42, Claus Ibsen <claus.ib...@gmail.com> wrote: > > > > > > > Yes it is. > > > > > > > > You need to run the camel plugin in its own maven execution first so > > > > the source is generated prior to running maven again to test or > > > > compile or whatever. > > > > You cannot run this in a single maven command from clean. > > > > > > > > > > > > On Mon, Mar 28, 2022 at 12:18 PM Minh Tran <minh.tran...@gmail.com> > > wrote: > > > > > > > > > > Hi > > > > > > > > > > This is not a chicken and egg problem. I've recreated a basic project > > > > > illustrating the problem > > > > > > > > > > git clone https://bitbucket.org/minh_tran__/camel_plugin_bug.git > > > > > > > > > > mvn clean test. -> will always fail. I've ensured clean will always > > > > remove > > > > > the autogenerated classes > > > > > mvn test -> second attempt without the clean will pass > > > > > > > > > > On Mon, 28 Mar 2022 at 19:32, Claus Ibsen <claus.ib...@gmail.com> > > wrote: > > > > > > > > > > > Hi > > > > > > > > > > > > Its a chicken and egg situation. Therefore its best to use the > > plugin > > > > > > to generate the source code ahead of time, eg in src/generated or > > > > > > directly into the source folder - as shown in the doc page. > > > > > > > > > > > > On Mon, Mar 28, 2022 at 10:24 AM Minh Tran <minh.tran...@gmail.com > > > > > > > wrote: > > > > > > > > > > > > > > On Mon, 28 Mar 2022 at 18:14, Claus Ibsen <claus.ib...@gmail.com > > > > > > > wrote: > > > > > > > > > > > > > > > Hi > > > > > > > > > > > > > > > > The docs tells you where it outputs and how you can add > > plugins to > > > > > > > > include the src/generated folder > > > > > > > > > > > > > > > > > > > > https://camel.apache.org/manual/camel-component-maven-plugin.html#_generate > > > > > > > > > > > > > > > > > > > > > Yes you can change the defaults but the problem is that the > > current > > > > > > > defaults help to hide the bug in the plugin. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > You can also set which phase to execute the plugin > > > > > > > > > > > > > > > > > > > > > > I tried both generated-sources and compile phase. > > > > > > > - generated-sources didn't generate anything. > > > > > > > - compile did generate the code but it executes after the > > compiler > > > > runs > > > > > > so > > > > > > > it never gets a chance to compile it. I tried moving the > > > > > > > camel-component-maven-plugin to appear before the > > > > maven-compiler-plugin > > > > > > in > > > > > > > the pom.xml but this seems to have no effect in the order of > > > > execution. I > > > > > > > am using maven 3.6.0 > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Claus Ibsen > > > > > > ----------------- > > > > > > http://davsclaus.com @davsclaus > > > > > > Camel in Action 2: https://www.manning.com/ibsen2 > > > > > > > > > > > > > > > > > > > > > > -- > > > > Claus Ibsen > > > > ----------------- > > > > http://davsclaus.com @davsclaus > > > > Camel in Action 2: https://www.manning.com/ibsen2 > > > > > > > > > > > > -- > > Claus Ibsen > > ----------------- > > http://davsclaus.com @davsclaus > > Camel in Action 2: https://www.manning.com/ibsen2 > > -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2