Maven dependency for whole org.springframework

前端 未结 8 1965
滥情空心
滥情空心 2020-12-28 09:50

How to set Maven dependency for all org.springframework ?

I mean, how to do it in couple lines,instead of providing dependency for every module,e.g.:

8条回答
  •  长情又很酷
    2020-12-28 10:19

    This answer is aimed to newer version 4.X.X

    If you want to handle versions of dependencies more efficiently use this code before your tags.

    
        
            
                org.springframework
                spring-framework-bom
                4.2.2.RELEASE
                pom
                import
            
        
    
    

    Benefit of using the BOM is that you no longer need to specify the version of dependency. So your dependencies should looks like:

    
        
        
            org.springframework
            spring-core
        
        
            org.springframework
            spring-context
        
        
            org.springframework
            spring-web
        
        
            org.springframework
            spring-webmvc
        
    
    

提交回复
热议问题