Unit test is in Java, using Maven to build & run. I can use either local jars “outside” Maven or local Maven repository.
However, I’d like to figure out a way to do this automatically somehow, without changing the pom.xml->running ->changing the pom.xml
Is there any other way except the above or creating pom.xmls which only differ in the specific library version?
(I’m using IntelliJ if that’s of any use)
You could also read the version of your lib from a property, like
You can set this property in several ways, e.g. loading build-specific properties file.
You could even specify it as a parameter when running the build. On the command line svn, this is something like
Don’t know how to specify such an property when running Maven from inside IntelliJ, but I’m sure it’s possible….
This approach would give you full flexibility to freely speficy the lib version for each build. But if you only have a limited number of versions you want to choose from, using profiles is probably the better way to go. Just define a profile for each version number and the always tell Maven which profile to use when you run a build.