Consider a project that uses modello (or any other source code generation
plugin). Here is rough sequence of builder actions that occur during full
and incremental workspace builds. Note that code generation and compilation
of the generated code are performed by two different workspace builders,
MavenBuilder and JavaBuilder respectively.
clean build
m2e/modello deletes generated sources, as expected, this is necessary to
remove any stale generated sources
jdt builder removes generated .class files
full workspace build (JavaBuilder)
there are no generated sources to compile at this point
full workspace build (MavenBuilder)
m2e/modello is executed during 'generate-sources' phase, generated sources
folder is added to MavenProject model but the sources compilation is
deferred to JavaBuilder execution
m2e/tycho is executed but does not consider generated classes because they
have not been compiled yet
incremental build (JavaBuilder)
newly generated sources are compiled
incremental build (MavenBuilder)
m2e/tycho does not run during incremental build, it'd be prohibitively
expensive.
The short-term workaround is to change maven-bundle-plugin configuration to
NOT rely on presence of compiled generated sources classes.
The only solution I can think of is to invoke java compiler from MavenBuilder,
which will require non-trivial changes to JDT API.
Consider a project that uses modello (or any other source code generation plugin). Here is rough sequence of builder actions that occur during full and incremental workspace builds. Note that code generation and compilation of the generated code are performed by two different workspace builders, MavenBuilder and JavaBuilder respectively.
The short-term workaround is to change maven-bundle-plugin configuration to NOT rely on presence of compiled generated sources classes.
The only solution I can think of is to invoke java compiler from MavenBuilder, which will require non-trivial changes to JDT API.