views:

18

answers:

2

When I generate eclipse artifacts, Eclipse shows the source folder in this order.

src/test/java src/test/resources src/main/java src/main/resources

I would prefer,

src/main/java src/main/resources src/test/java src/test/resources

Thanks in advance!

A: 

I'm not aware of any configuration parameter in the maven-eclipse-plugin that would allow to tweak the ordering of classpathentry in the generated .classpath.

Assuming this is what Eclipse uses, changing the order would require patching the plugin.

Another option would be to use m2eclipse which gives you what you're looking for out of the box.

Pascal Thivent
Thanks man, I might look into. I'm not sure if anyone else would is annoyed with the test folders on top. Maybe I will get use to it.
Andy Pryor
A: 

This would break default functionality. Per convention, the contents of src/test/java and src/test/resources must be on top in the class path, so that you can easily replace artifacts from the main tree with test implementations without changing the main tree.

Example:

src/test/resources/META-INF/persistence.xml

src/main/resources/META-INF/persistence.xml

(tests will use the first version, while the second version will be deployed)

seanizer
Hmm... it's `target/test-classes` that must be before `target/classes` on the classpath. And this can be handled independently of source paths ordering. That's actually what m2eclipse does (you get `src/main/java`, `src/main/resources`, `src/test/java`, `src/test/resources` in that order under eclipse).
Pascal Thivent