Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] <runOnConfiguration> and copying resources

On Oct 18, 2012, at 8:05 PM, Igor Fedorenko <igor@xxxxxxxxxxxxxx> wrote:
> You can specify both runOnIncremental=true and runOnConfiguration=true

Yep, I'm doing this.

> in which case your plugin will be called with empty BuildContext during
> project import/configuration and will be called with actual changes
> during incremental or full workspace build. In both cases your plugin is
> expected to add new source root to MavenProject and in both cases it is
> expected to generate the code only if BuildContext hasDelta for input
> files of your plugin.

Yep, I'm also doing this.

But I can't determine the input files without the resources being copied to the target/classes directory first. The code that I'm wrapping (UIMA's JCasGen) takes an input "type system" file that can refer to other files via the classpath. These referenced files could be in jars, in src/main/resources, or anywhere else in the project as long as they end up on the classpath. So I have to load the "type system", let it resolve references via the classpath, and then I can check the hasDelta on all the "input files" it has found, and then (finally!) I can determine whether or not I should actually generate code.

The problem seems to be that resources:resources isn't copying anything over during project import/configuration. It does appear to run before my "jcasgen-maven-plugin":

20:55:54.518 [Thread-1] DEBUG o.e.m.c.i.builder.MavenBuilderImpl - Executing build participant org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant for plugin execution org.apache.maven.plugins:maven-resources-plugin:2.5:resources (execution: default-resources, phase: process-resources)
20:55:54.518 [Thread-1] DEBUG o.e.m.c.i.builder.MavenBuilderImpl - Finished executing build participant org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant for plugin execution org.apache.maven.plugins:maven-resources-plugin:2.5:resources (execution: default-resources, phase: process-resources) in 0 ms
20:55:54.518 [Thread-1] DEBUG o.e.m.c.i.builder.MavenBuilderImpl - Executing build participant org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant for plugin execution org.cleartk:jcasgen-maven-plugin:0.9.3-SNAPSHOT:generate (execution: default, phase: process-resources)
…

But it doesn't copy any files over (which I can see if I pause execution at the point above). The log suggests that the maven-resources-plugin completes in 0 ms, which seems a little quick since it should have copied at least 4 files in this case.

Any ideas why I'm not seeing any resources copied by the maven-resources-plugin?

I browsed around the m2e git repository for a while (and the maven-resources-plugin svn repository), but I can't figure out how the maven-resources-plugin determines whether it should run or not during import/configuration...

Steve



Back to the top