Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349525 - Create a preferences option to disable excluding resources on classpath
Summary: Create a preferences option to disable excluding resources on classpath
Status: CLOSED DUPLICATE of bug 356568
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: m2e (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-16 03:54 EDT by Aaron Digulla CLA
Modified: 2021-04-19 13:24 EDT (History)
2 users (show)

See Also:


Attachments
My configuration (798.05 KB, text/plain)
2011-08-04 05:17 EDT, Aaron Digulla CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Digulla CLA 2011-06-16 03:54:18 EDT
My tests fail when the .classpath contains excluding="**" so I have to remove it again and again...

Please add a preferences option to disable adding 'excluding="**"' to .classpath.
Comment 1 Igor Fedorenko CLA 2011-08-01 03:09:55 EDT
please provide complete standalone example project and steps to reproduce the problem. m2e is expected to copy contents of resources and test resources folders to their respective output folders, so tests should have all resources available to them.
Comment 2 Aaron Digulla CLA 2011-08-02 06:29:42 EDT
What I see is that resources just aren't copied. On second thought, it makes sense to have Maven copy them (so the resource filtering can take place) but somehow it *sometimes* fails.

I have a huge project where it sometimes fails, I'm not sure whether I can strip that down. My experience is that once in a while, the resources just don't show up in the target/*classes/ folder. No amount of cleaning and updating the config will make m2e do its job.

The only reliable solution that I've found is to remove 'excluding="**"' when I see it has been added again.

But maybe it's a problem with the POM. I have a src/site folder. To enable filtering resources, I've added this to the POM:

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>src/site</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

If I omit these lines, then no resources are copied when I run Maven 3.0.3 from the command line! Maybe that's related. What are the inheritance rules for the resources element? Where is the default defined? How does Maven merge these elements if they exist in several parent POMs?
Comment 3 Igor Fedorenko CLA 2011-08-02 06:50:56 EDT
Can you attach your eclipse configuration details here (about_eclipse->installation_details->configuration)?
Comment 4 Aaron Digulla CLA 2011-08-04 05:17:34 EDT
Created attachment 200892 [details]
My configuration
Comment 5 Aaron Digulla CLA 2012-12-05 03:22:09 EST
This bug still happens with 1.1: Sometimes, Eclipse simply doesn't copy resources. My guess is that the delta builder sometimes doesn't invoke "mvn copy-resources" but I can't come up with a stable test case.

I'm now upgrading to 1.2 and I'll keep an eye on it.
Comment 6 Aaron Digulla CLA 2012-12-05 03:29:42 EST
Is there a reason why m2e adds excluding="**"?
Comment 7 Igor Fedorenko CLA 2012-12-05 07:59:45 EST
(In reply to comment #6)
> Is there a reason why m2e adds excluding="**"?

m2e uses maven-resources-plugin to process maven resources. Source folders are created for presentation purposes only, i.e. make them stand out in package explorer.
Comment 8 Igor Fedorenko CLA 2013-09-29 09:46:43 EDT

*** This bug has been marked as a duplicate of bug 356568 ***
Comment 9 Denis Roy CLA 2021-04-19 13:24:42 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/