I would like to have two independent maven projects in two different folder like c:\test\ProjectOne
and c:\test\ProjectTwo
. In both maven project i would like to have a dependency library, for eg; selenium, with two different versions. In ProjectOne, would want to have selenium with version 3.141.0
and in ProjectTwo, would want to have selenium with version 4.26.0
. As even though both are two different maven projects,
c:\user\<user>\.m2
folder, how does both the projects selenium version will be present. Will it override one over other? or does it harm in any of the projects?please help me understand the logic here.
No, it will not be a problem with your setup. You can have the setup like you have mentioned with 2 separate projects.
Each project will have it's own pom.xml, describing the dependencies necessary for those projects respectively, so you will have versions defined in each of their own pom files.
Your local repository
c:\user\<user>\.m2
can have multiple versions, they get organized under folders with version number. Good luck!