I have a dependency that I want to use in test
scope (so that it is in the classpath when I am running unit tests), and in runtime
scope (so that I can
Not sure if this would still help someone who is still looking for a simple way to do this - https://howtodoinjava.com/maven/maven-dependency-scopes/ this link helped me add the correct scope. Here is the summary of mapping of scopes and the phases where we need the dependencies.
So, when I needed the dependency during test and runtime, I gave the scope as "runtime" and it worked as expected.