Add Hibernate to STS Dynamic Web Project

2019-06-02 16:30发布

问题:

I have a Dynamic Web Project which I am developing using STS.

I want to add Hibernate to it. Is it a matter of adding the necessary jar files to the project manually, or is there some trick that I am missing that will just allow me to "Add Hibernate" ?

回答1:

You need to add the jars.

  • If it is no maven project then copy the jars to: webapp/WEB-INF/lib
  • If you use maven then add the hibernate dependencies to your pom

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>3.6.1.Final</version>
    </dependency>