[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.iam] Re: Apparent Maven / JUnit clash in eclipse

Hello Ben,

BenH wrote:

Maven likes to compile test code to /target/test-classes

This isnt part of the default Build Path.

I have created a new maven project by using the wizard and checking the "Create a simple maven project" checkbox.


In this project, src/main/java has its output folder set to default (target/classes) and src/test/java has its output folder correctly set to target/test-classes.

There might be a glitch somewhere else... can you provide more information on how did you configure your project?

When eclipse's JUnit launcher runs, it doesnt include /target/test-classes in its classpath, and no test classes are found.

This works with the simple project created above (Right-click project, Run as, Junit Test).


My workaround is to add /target/test-classes to the Run Classpath of my unit test launch shortcut.

If needed, you could set the output folder for the src/test/java source folder (in the Java Build Path project properties).


Plus, Ive found I need to run mvn compiler:testCompile manually, because the eclipse builder seems not to (always) build that folder automatically?

There have been attempts to improve performance by avoiding running maven goals when not needed. Maybe there is some corner case that is not properly handled.


A test case would be very welcome.

It would be nice to get better integration here eventually.

Sure! Feedback from the community (like yours) will allow us to achieve it. -- Abel Muiño