欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Intellij项目搭建(二)------pom.xml配置

程序员文章站 2024-02-02 23:13:40
...
  1. 添加Spring-core核心jar包,参考jar库地址:https://mvnrepository.com/open-source/http-clients

    org.springframework
    spring-core
    4.2.5.RELEASE
    Intellij项目搭建(二)------pom.xml配置

  2. 类似配置,添加如下

    org.springframework
    spring-context
    4.2.5.RELEASE

  3. 配置统一版本号。下添加,<spring.version>4.2.6.RELEASE</spring.version>
    <hibernate.version>5.1.0.Final</hibernate.version>
    spring的jar包version值替换为${spring.version},这样可以统一版本升级。

  4. 添加其他配置项

    org.springframework
    spring-webmvc
    ${spring.version}

    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-jpa</artifactId>
        <version>1.10.1.RELEASE</version>
    </dependency>
    
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>${hibernate.version}</version>
    </dependency>
    
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-c3p0</artifactId>
        <version>${hibernate.version}</version>
    </dependency>
    
    <dependency>
        <groupId>com.mchange</groupId>
        <artifactId>c3p0</artifactId>
        <version>0.9.5.2</version>
    </dependency>
    
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
    
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.39</version>
    </dependency>