Minimum JARs for Spring 3.0 dependency injection

前端 未结 3 1545
无人共我
无人共我 2021-02-08 01:47

Similarly to this question regarding an earlier Spring version, what are the minimum dependencies required for an application to use Spring 3.0 dependency injec

3条回答
  •  悲哀的现实
    2021-02-08 02:50

    YMMV, but I'd do the following:

    First, import the Spring BOM in the dependency management section, to ensure a baseline dependency version:

    
        3.2.6.RELEASE
    
    
        
            
                org.springframework
                spring-framework-bom
                ${spring.version}
                pom
                import
            
         
     
    

    Then, in the build/dependency section, import beans, context and core, and EL if you plan to configure Spring via xml configuration (or using test scope if you only plan to use Spring xml configuration for your tests harness.)

    Note: This example is with 3.2.x. If you need to use Spring before 3.2.x, you will need to include asm explicitly. One possibility is to use a profile activated only for Spring versions below 3.2.x.

    
        
           
                org.springframework
                spring-core
                
           
           
                org.springframework
                spring-beans
           
           
                org.springframework
                spring-context
           
           
                org.springframework
                spring-expression
                test
           
        
    
    

提交回复
热议问题