In my Java micronaut microservice, I want to use a version of a maven dependency for my main code and another different version of the same maven dependency for unit tests code. So, how can I achieve this?
I am trying to do something like this but it looks like it is using test version only that is 2.2.2 for both main and unit tests code.
<dependencyManagement>
<dependencies>
<!-- version for main code -->
<dependency>
<groupId>a.b.c.d</groupId>
<artifactId>w-x-y-z</artifactId>
<version>1.1.1</version>
</dependency>
<!-- version for unit tests code -->
<dependency>
<groupId>a.b.c.d</groupId>
<artifactId>w-x-y-z</artifactId>
<version>2.2.2</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>