I have projects A and B, where B requires A. Inside the project AI there is a UC of class UC, which should be available only for JUnit tests and, therefore, is in src/test/java project A. As long as I I write tests in AI have access to UC. However, if I run Maven and want it to run tests in B, I get compiler errors because UC is not available in B.
Obviously, Eclipse includes all classes in all source folders when it compiles something (that is, it knows about UC when I write tests in B), and Maven removes all test classes in the final version of A.
My question is: what do I need to do to make UC available in B when I run its tests with Maven?
Please understand that I am new to Maven and I think similar questions have been asked. However, I cannot convert what is written there and correct it.
I hope this is clear what I'm trying to do ...
maven junit dependencies project-structure
sjngm
source share