Hello,

I have an issue with m2e when chaining plugins in Maven, i.e. when the
output folder of first plugin is used by second plugin as an input folder.
A small example below:

1. my first plugin generates JFlex source files out of XML using XSLT and
puts everything into /target/generated-sources/src-jflex. This is bound to
'generate-sources' phase.
2. then JFlex plugin uses the /target/generated-sources/src-jflex folder as
input (lexDefinitions), and generates Java source files to
/target/generated-sources/jflex. This is bound to 'process-sources' phase
to ensure that the results of step 1 are visible to JFlex plugin.

This works correctly from the command line, using 'mvn clean install'.

Now I try using it with m2e. I have created a connector for my plugin (step
1), which uses `buildContext.refresh(src-jflex-dir)` to refresh the
generated JFlex sources.

However, when I run it in m2e, JFlex plugin's connector cannot find the
generated source directory in the Workspace and therefore does not execute.

After a little debugging, I see that in
org.eclipse.m2e.core.internal.builder.MavenBuilderImpl#build(),
all build participants are launched in the same loop, and resource refresh
is performed only after all participants execute. This looks too late in my
case, because I need the output folder from step1 to be refreshed before
step2 participant is executed.

Am I using it wrong? Is there any way to achieve that the folder is
refreshed before JFlex plugin starts the build? Or some option to get m2e
respect different build phases to achieve the order?

Thank you,
~Andrius Velykis
_______________________________________________
m2e-users mailing list
m2e-users@eclipse.org
https://dev.eclipse.org/mailman/listinfo/m2e-users

Reply via email to