Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] resources missing from classpath when debugging


On 12/9/2010 8:09 AM, Benson Margulies wrote:
> In the last few days, I've lost the ability to run classes from
> m2eclipse which depend on finding resource files from
> src/main/resources in their classpath.  Unit tests that work fine from
> the mvn command line fail in eclipse, and ordinary java main programs
> get a null when asking the usual find resource API to return them.
>
> src/main/resources does show as a source folder in the explorer. It
> has the correct target folder of PROJ/target/classes.
>
> The reason for the problem is that Something has added an 'exclude' of
> '**' to the build path entry for src/main/resources.

Hi,

I'm running m2eclipse 0.12.0.20101115-1102 (the released version). 

I believe m2eclipse does this "exclude" of "**" on resources, on purpose,
because it is trying to substitute a maven "process resources" lifecycle step as
part of the Eclipse build.  This is done so that maven things like filtering
resources can happen - in order to get the Eclipse builds to work like the maven
builds.

Just for comparison, I looked and see that I also have '**' in the exclude for
my resources (both main and 'test').  Nevertheless, I can individually build my
projects (Eclipse menu -> project -> clean), without error.  When I do that, I
can see in the m2eclipse console window the filtering etc., steps happening.

I also tried picking one junit test that has a dependency on test/resources
(which also has the exclude of ** ) and tried running it by right clicking it
and saying run - as- junit test, and that also worked for me.

-Marshall Schor

> I certainly didn't.
> _______________________________________________
> m2e-users mailing list
> m2e-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/m2e-users
>
>


Back to the top