renren-security旧版本 分模块 的模块之间关系浅析
Maven结构,一个父模块 六个子模块 七个pom.xml;
\git\renren-security\pom.xml
<modules> <module>renren-common</module> <!--公共模块--> <module>renren-shiro</module> <!--权限系统模块--> <module>renren-schedule</module> <!--定时任务模块--> <module>renren-gen</module> <!--代码生成器模块--> <module>renren-api</module> <!--API模块--> <module>renren-web</module> <!--管理后台模块--> </modules>
<properties>
/
/定义各jar包的 版本号,被用来引用,
<properties>
<properties> <renren-version>2.0.0</renren-version> <java-version>1.7</java-version> <servlet-version>3.1.0</servlet-version> <junit-version>4.12</junit-version> <springframework-version>4.3.7.RELEASE</springframework-version> <mybatis-version>3.4.1</mybatis-version> <mybatis-spring-version>1.3.0</mybatis-spring-version> <mysql-version>5.1.38</mysql-version> <hibernate-validator-version>5.4.1.Final</hibernate-validator-version> <druid-version>1.0.28</druid-version> <commons-lang-version>2.6</commons-lang-version> <commons-fileupload-version>1.3.1</commons-fileupload-version> <commons-io-version>2.5</commons-io-version> <commons-codec-version>1.10</commons-codec-version> <commons-configuration-version>1.10</commons-configuration-version> <slf4j-version>1.7.19</slf4j-version> <log4j-version>1.2.17</log4j-version> <fastjson-version>1.2.30</fastjson-version> <shiro-version>1.3.2</shiro-version> <kaptcha-version>0.0.9</kaptcha-version> <velocity-version>1.7</velocity-version> <velocity-tools-version>2.0</velocity-tools-version> <jstl-version>1.2</jstl-version> <taglibs-version>1.1.2</taglibs-version> <freemarker-version>2.3.23</freemarker-version> </properties>
排除传递依赖:
exclusions
<dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity-tools</artifactId> <version>${velocity-tools-version}</version> <exclusions> <exclusion>//这里就是排除传递依赖<artifactId>dom4j</artifactId> <groupId>dom4j</groupId> </exclusion>
git\renren-security\renren-web:
pom.xml:
上图说得很明白: 父模块,项目名称,打包方式war表面是一个web模块,依赖于5个子模块,为什么要定义build finalName renren-security ??
/renren-web/src/main/resources/spring-mvc.xml
<context:component-scanbase-package="io.renren" />//扫描包,有什么用不记得了??<context:annotation-config/> <mvc:default-servlet-handler/> <aop:aspectj-autoproxyproxy-target-class="true" /> <mvc:annotation-driven>//注解驱动<mvc:message-convertersregister-defaults="true"> <beanclass="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter"> //Json解析器
git/renren-security/renren-shiro/pom.xml
上面 说明了,父模块是谁,模块名称,打包方式,依赖哪个模块
/renren-shiro/src/main/resources/renren-shiro.xml
/renren-common/pom.xml
==》pom.xml
/renren-common/src/main/resources/mybatis.xml 里面只配置了 <setting name="mapUnderscoreToCamelCase" value="true" /> 不确定作用???
/renren-common/src/main/resources/spring-jdbc.xml 很多配置,里面很多都不确定作用?
<beanid="druid-stat-pointcut"class="org.springframework.aop.support.JdkRegexpMethodPointcut"scope="prototype"> <propertyname="patterns"> <list> <value>io.renren.controller.*</value> <value>io.renren.service.*</value> </list> </property> </bean> <aop:config> <aop:advisoradvice-ref="druid-stat-interceptor"pointcut-ref="druid-stat-pointcut"/> </aop:config> <beanclass="org.mybatis.spring.mapper.MapperScannerConfigurer"> <propertyname="basePackage"value="io.renren.dao" /> </bean>
其它模块的配置文件 在此不说明了,