Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] [m2eclipse-user] Resources in target/test-classes are removed

m2e has the logic to process resources and does not need/use JDT for
that. Source-path entries for resources folders are only needed to make
Package Explorer view render them specially and serve no other purpose.
By removing excludes=** you basically make both JDT and Maven builders
process the same resources and this is bound to cause problems.

What you see is likely MNGECLIPSE-823 [1] and custom lifecycle mapping
[2] is the only solution to that problem available at the moment



PS: please use m2e-users@xxxxxxxxxxx mailing list

On 10-11-09 12:52 PM, Abid Hussain wrote:
Hi again,

I'm encountering a strange misbehaviour in m2eclipse 0.10.

As in pom.xml defined, several test resources in src/test/resources
are declared (to be copied to target/test-classes).

When eclipse performs "Building workspace", all resources from
src/test/resources are properly copied to target/test-classes.

But then, "Building workspace" is performed a second time (don't know
why) and all resources are removed again from target/test-classes.

This behaviour makes it impossible to run any JUnit test which depends
on any kind of resource.

Now it becomes interesting. The copying of test resources is
configured like this:

When I took a look in the Build Path properties of eclipse (Build Path
->  Configure Build Path) the file exclusion pattern of the source
folder src/test/resources was "**".

Those properties have been generated from m2eclipse I believe. When I
manually changed this property to "None", everything works fine: all
resources are copied to test-classes and aren't being removed.

My suspicion is the following: when checking out a project from SVN,
m2eclipse offers to check it out as maven project and generates all
eclipse specific files (.project, .classpath, etc.), right?

But what happens when the pom.xml is changed in future? Are the
eclipse project files are also being updated from m2eclipse?



Back to the top