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 9:16 PM, Steven Bethard <steven.bethard@xxxxxxxxxxxx> wrote:
> The problem seems to be that resources:resources isn't copying anything over during project import/configuration.

Ok, after some more debugging, I conclude that this is intentional, since <runOnConfiguration> is not set to "true" for the "maven-resources-plugin":

http://git.eclipse.org/c/m2e/m2e-core.git/tree/org.eclipse.m2e.lifecyclemapping.defaults/lifecycle-mapping-metadata.xml

So I can't even collect the input files that I should be checking with BuildContext.hasDelta because:
* I have to load the TypeSystem to find all the input files
* Loading the TypeSystem with an incomplete classpath will result in errors
* The classpath is incomplete because maven-resources-plugin has not copied the resources

Is there some other way to tell that I'm in the project import/configuration phase? Here's a horrible hack that seems to work:

    if (this.buildContext instanceof ThreadBuildContext
        && ThreadBuildContext.getContext().getClass().getName().equals(
            "org.eclipse.m2e.core.internal.builder.EclipseEmptyBuildContext")) {
      return;
    }

Is there something nicer than this?

Steve

Back to the top