Which maven dependencies to include for spring 3.0?

前端 未结 8 508
太阳男子
太阳男子 2020-11-29 14:55

I am trying to do my first project with Spring 3.0 (and maven). I have been using Spring 2.5 (and primer versions) in quite some projects. Nevertheless I am kinda confused,

相关标签:
8条回答
  • 2020-11-29 15:20

    You can try this

    <dependencies>
    
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>3.1.0.RELEASE</version>
        </dependency>
    
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>3.1.0.RELEASE</version>
        </dependency>
    
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>3.1.0.RELEASE</version>
        </dependency>
    </dependencies>`
    
    0 讨论(0)
  • 2020-11-29 15:20

    Use a BOM to solve version issues.

    you may find that a third-party library, or another Spring project, pulls in a transitive dependency to an older release. If you forget to explicitly declare a direct dependency yourself, all sorts of unexpected issues can arise.

    To overcome such problems Maven supports the concept of a "bill of materials" (BOM) dependency.

    https://docs.spring.io/spring/docs/4.3.18.RELEASE/spring-framework-reference/html/overview.html#overview-maven-bom

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-framework-bom</artifactId>
      <version>3.2.12.RELEASE</version>
      <type>pom</type>
    </dependency>
    
    0 讨论(0)
提交回复
热议问题