If I'm looking at a class (MyComponent, say) somewhere underneath src/main/java in Eclipse, I can right click it and pick new...--> other --> JUnit test. Eclipse is smart enough to guess the name for the unit test class (MyComponentTest), but it insists on putting the unit test under src/main/java. Is there anything in Eclipse or m2Eclipse that can be set so that the default test location is src/test/java? Given that's the standard way of working with Maven, there has to be a setting for this somewhere but I can't find it.
Good question, this bothers me too. I googled it and found this suggestion: How to default the source folder for new JUnit tests in Eclipse?.
Basically it says: I use moreUnit, an Eclipse plugin to assist writing unit tests. Among other features, it lets you configure the default source folder of tests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With