I have two folders, src and test (for junit). When I export, the test folder gets packaged into the jar with JUnit which I don't want. I went to Build Path for the project an tried to deselect the 'test' folder in 'order of export' but it does not allow me to deselect it.
I then tried exclude the folder in the 'soruces' tab using * (everything), but then I got an error when I tried to export.
How do I exclude my test folder from the export?
Right click on project, goto Build Path -> Configure Build Path, then goto the Libraries Tab, select the Referenced library and click remove.
On the Propertis dialog, select the Java Build Path from the list of properties. On the Java Build Path part of the dialog, select the Libraries tab. Find the entry in the list of libraries called Shared Library [<library-name>], and then select it. Click Remove.
I have just did it and it worked fine for me. Here is what I did.
I also met the same problem and eventually resolved it by moving the tests into a separate Eclipse project, placing the original project as a build path dependency of the test project. I know this is rather a workaround than a desired direct solution of the problem, but to me it looks like the best approximation to the desired solution:
The only drawback is that an extra project needs to be created.
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