Skip to main content

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

I have a Maven plugin that needs to run after resources have been copied to target/classes, and before any Java code compilation takes place. So I have declared it with "@phase process-resources", and this works fine with Maven at the command line.  It also works fine if I specify <runOnIncremental>true</runOnIncremental> in my m2e lifecycle mapping.

However, if I specify <runOnConfiguration>true</runOnConfiguration> in my m2e lifecycle mapping, on project import, resources are not copied to target/classes before my plugin runs. I found this issue by running my tests in a debugger. When my Mojo's execute method is called during project import, the path <root>/junit-workspace/<project>/target/ is empty. When my Mojo's execute method is called during a full or incremental build, the resource files are there in target/classes.

My plugin adds a new source directory to the Maven project, so I do believe I need to specify <runOnConfiguration>true</runOnConfiguration>. Is there something additional I need to do to specify to m2e that the resources:resources plugin must run before my plugin?

Thanks,

Steve







Back to the top