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

I actually just opened a feature request for this yesterday at
https://bugs.eclipse.org/bugs/show_bug.cgi?id=392211.

In my case I'm having trouble with the CXF codegen plugin. I'm doing
some filtering (using the maven resources plugin) on the WSDL prior to
running code generation, but during the configuration build CXF
complains about missing files and then fails to add the generated
source directory. I want to contribute a patch to CXF, but in order to
do that I need a good way to detect the configuration build.

For plugins that only process files inside the project, the build
context hasDelta() checking is probably sufficient to avoid building
during configuration. However, plugins that use external resources
need to implement their own delta checking for their external
resources, and they may end up running during the configuration build
if an external resource has changed. We need a way to prevent that.

Maybe any plugins that use external resources should have dedicated
m2e connectors, but that is a lot more work.

Josh

On Fri, Oct 19, 2012 at 9:25 AM, Steven Bethard
<steven.bethard@xxxxxxxxxxxx> wrote:
> On Oct 19, 2012, at 4:24 AM, Igor Fedorenko <igor@xxxxxxxxxxxxxx> wrote:
>> Your maven plugin is expected to only add new source root and do nothing
>> else during import/configuration. All source code generation should
>> happen during normal full/incremental build.
>
> So how do I tell from my plugin that it's project import/configuration and not a normal full/incremental build?
>
> Steve
>
>>
>> --
>> Regards,
>> Igor
>>
>> On 12-10-19 12:56 AM, Steven Bethard wrote:
>>> 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
>>> _______________________________________________
>>> m2e-dev mailing list
>>> m2e-dev@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/m2e-dev
>>>
>> _______________________________________________
>> m2e-dev mailing list
>> m2e-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/m2e-dev
>
> _______________________________________________
> m2e-dev mailing list
> m2e-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/m2e-dev


Back to the top