Euguuu
Euguuu

Reputation: 186

m2eclipse workspace resolution classpth and test folder

I am using m2eclipse for manage my classpath in eclipse, and i have a problem when i want use test-compile goal in eclipse.

i have 2 projects A & B, project B depend A for class (in folder target/classes) and test class (in folder target/test-classes). If I run test-compile goal in m2 eclipse launcher with parameter M2_WORKSPACE_RESOLUTION=true the compilation can not find test classes of project A.

In command line everythings are ok. If I use M2_WORKSPACE_RESOLUTION=false everythings are ok.

How can I force m2eclipse to use test class with workspace resolution ?

Upvotes: 2

Views: 415

Answers (2)

Euguuu
Euguuu

Reputation: 186

it's an issue of M2eclipse:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=352962

The dependency resolution will work (it seems) with in the JVM that is running Eclipse. But if another JVM is launched then it won't.

Upvotes: 0

SpaceTrucker
SpaceTrucker

Reputation: 13546

You have to declare a dependency on the test classes of project A explicitly. See this question on how to do that. Test classes are normally not packaged in the artifact. That's why you can't access those classes from project B.

Upvotes: 2

Related Questions