I'm working on a maven-spring-web project in Eclipse. I am getting some problem working with jUnit tests, it seems to me a configuration issue.
Project structure:
src > main > java : business logic goes here
src > test > java : jUnit test cases are parked here.
The trouble is that imports are not working when im trying to import some business logic classes from src>main>java into my jUnit test cases. The reason is that the physical folder structure is :
Business logic classes : project_root > src > main > java
Test cases classes : project_root > src > test > java
I've tried cleaning, putting testResources directory in POM. I dont want to add classes folder in classpath. Pls advise.
You can't use default package in src/main/java, try to new a package and you can import the class then.
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