Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Separate class paths for test code and main code

I have two source trees in my Java application in Eclipse. One is "src", and one is "test". Each one contains a directory tree of .java files. So far, so good.

However, I would like the classes in "test" to be able to see the classes in "src", but for the classes in "src" to not be able to see the classes in "test". Similarly, I want to include some test libraries. I don't want any of those libraries to be available in the "main" tree, lest I accidentally use one without thinking.

Is there an easy way to set this up in Eclipse?

like image 457
Brandon Yarbrough Avatar asked Feb 14 '10 01:02

Brandon Yarbrough


1 Answers

There is no way to solve this in Eclipse without splitting the two source trees into separate projects (with one depending on the other). Maven could handle that at build time though.

like image 113
Pascal Thivent Avatar answered Oct 26 '22 02:10

Pascal Thivent