参考资料:github介绍 https://github.com/spring-projects/spring-framework/wiki/Downloading-Spring-artifacts
介绍:在我们搭建j2ee工程时,往往会用到spring的相关jar包(spring-mvc、spring-core、spring-context等),而现在搭建web工程往往都是通过maven或者gradle等工具进行管理。以maven为例,当我们选择spring时,会面临如下几个问题:
1> 不知道会用到spring哪些相关jar包?
2> spring的artifacts在pom中不知道怎么配置?
3>spring是怎样定义出dependency的?
带着上面疑问,解读一下github上wiki说明,其实spring是分模块化划分项目,如下是spring相关项目:
spring版本说明:
通过以上两张图片,很容看明白spring有多少个项目,每个项目版本是怎样迭代的。弄明白后,maven管理就更容易懂了:
实例:
<dependency>
<groupId>org.springframework</groupId> <!--groupId 特定-->
<artifactId>spring-context</artifactId> <!--模块名称-->
<version>3.1.0.RELEASE</version> <!--版本号-->
</dependency>