I have imported some projects in eclipse through Maven. I want to access the methods from that project in my sample project. But normally when we want to access the method from some project,we just import the package and simply access the method.
But as it imported through Maven it is not local to system. So I decided that if I set the classpath to that particular project/package then may be it works.
What should I do to access the methods from it or how Should I set the classpath for it?
If you know this please suggest me as soon as possible. I never worked on this situation.
Please advice
The Maven plugin for eclipse will dynamically build the classpath for your projects based on their maven dependencies. Now, that classpath will be made up of your projects and, as @plucury says, what’s in
~/.m2/repository.If you want to follow methods and see the source implementation of the imported libraries, eclipse will work as usual (because it’s just referencing jars from a different folder), but by default eclipse will not instruct maven to also download javadoc or source bundles for your classes. To do that, you need to set it in Windows>Preferences>Maven (Download Artifact Sources and Download Artifact Javadocs). In my experience, eclipse will not do that for already downloaded bundles, so you’ll have to manually erase them from
~/.m2/repositoryand compile again. When eclipse downloads the jar, this time, it will also get the source, which will let you follow through.