Basic Question over adding libraries to project
- I create a new project named XXX using Maven.
- I do mvn eclipse:eclipse to to ensure it g开发者_JS百科ets imported to Eclipse.
Now i am going to indite a Spring and Hibernate application. I need jars to be added. Where should i add them and How?
Please explain me in lame man language.
First you do what you'd always do in Maven. Add to the <dependencies/> element of your POM.
Then you re-rerun eclipse to get a new .classpath with the new stuff in it.
Add them in your maven pom, then regenerate your project as you did originally. Don't try to maintain dependencies in the project and your pom, as this will lead to inconsistencies.
As a better alternative, use the M2Eclipse plugin instead and then your eclipse and maven environments will be actually integrated.
精彩评论