I created with maven a module P that has 3 submodules: A, B, C. B and C implement A but they have nothing to do with each other. I have to test the interaction between classes from B and from C (something like server-client connection). Is there a way (that doesn't need the creation of a fourth module) to do this?
- Make B a test-scope dependency of C?chrylis -cautiouslyoptimistic-– chrylis -cautiouslyoptimistic-2017-04-03 16:43:53 +00:00Commented Apr 3, 2017 at 16:43
- I want B and C to be distributed separatelySnowyCoder– SnowyCoder2017-04-03 16:50:09 +00:00Commented Apr 3, 2017 at 16:50
- Read up on Maven scopes.chrylis -cautiouslyoptimistic-– chrylis -cautiouslyoptimistic-2017-04-03 16:55:33 +00:00Commented Apr 3, 2017 at 16:55
- Thank you, I forgot that it existed, can you write it as an answer so I can accept it?SnowyCoder– SnowyCoder2017-04-03 17:02:34 +00:00Commented Apr 3, 2017 at 17:02
Add a comment |
1 Answer
If you want to be able to test interactions between the two projects but you don't have any other dependencies between them, you can make one (C) depend on the other (B) and use the Maven test scope. This will make the classes from B available for your test code, but there won't be any relationship or dependency in the packaged artifacts or anything that depends on them.