it might be a duplication, but in eclipse, how can I deal with various dependency versions of the same library in my local maven repository ?
The problem is that dependency versions specified in pom definition are the libraries I need to use (they have sources/javadoc available etc.), but maven puts all the available library versions on classpath, so that if I ctrl+shift+T or step into some class which belongs to that dependency, it might be the one without sources/javadoc, the one not declared in pom definition but in local maven repo. There is no way of setting up precedence.
There is a feature “Remove from history” right in the pup up window (Ctrl+shift+T), but it is practically useless, doesn’t work.
No, that’s not true. Maven puts on the class path what you tell him to put on it.
With Eclipse, when you Open Type, Eclipse simply searches for the type in the classpath of all projects in the workspace. So if you have a project A that has
foo-X.jaron its classpath and a project B that hasfoo-Y.jaron its classpath and if both contain theBartype, searching forBarwould list both versions.But Eclipse doesn’t search in JARS that are not defined as dependencies of projects in your worskpace, it doesn’t search in all JARs of your local repository. And this is not really a Maven or m2eclipse specific issue.
That said, the only way I know to restrict the search to, say the dependencies of project A only, would be to define a Working Set using the menu under the upper right arrow: