First, development tools: Idea
Second, the database: MySQL
Third, language: Java
Iv. Record of issues:
1, write test classes to test, you need to pay attention to the dependency to rely on another module, the scope of test can not inherit, such as:
Pom.xml under the Xxx-commons module:
<!--unit Test-->
<dependency>
<groupId>junit</groupId>
<artifactid>junit </artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
When Xxx-manager relies on xxx-commons, the top two jars cannot be relied upon:
<dependency>
<groupId>com.ssl</groupId>
<artifactid>xxx-commons</artifactid >
<version>1.0-SNAPSHOT</version>
</dependency>
At this point, JUnit and spring-test are not introduced to the Xxx-manager module, but when Xxx-manager is a xxx-commons child module, it can be referenced.
2, the use of spring-test, JUnit writing test classes, you need to introduce
<dependency>
<groupId>javax.servlet</groupId>
<artifactid>javax.servlet-api </artifactId>
<scope>provided</scope>
</dependency>
3, pay attention to the difference between classpath* and classpath: classpath* will scan each module classpath, and classpath only scan the current module.
4, when using MyBatis, when the SQL XML file and Mapper file is not in the same directory, configure the sqlsessionfactory, you need to use the specified mapperlocations, for example:
<!-- configuration sqlsessionfactory-->
<bean id= "sqlsessionfactory" class= " Org.mybatis.spring.SqlSessionFactoryBean ">
<!--mybatis configuration file, loaded paging plugin-->
<property name=" Configlocation "value=" Classpath:mybatis/sqlmapconfi.xml "/> <property name=" DataSource "ref=" DataSource
"/>
<!--specify Mapping.xml file-->
<property name=" mapperlocations "value=" classpath:com/ssl/shop/ Mapper/xml/*.xml "/>
</bean>
<!--Configure scan packages to load Mapper proxy objects-->
<bean class=" Org.mybatis.spring.mapper.MapperScannerConfigurer ">
<property name=" Basepackage "value=" Com.ssl.shop.mapper "/>
</bean>
5, Idea, by clicking on the right of MAVEN projects, there will be various MAVEN project dependencies and plug-in details, can also select Plug-ins, directly run, but plugins under the Install-install:install command will be an error, You should select the square m icon above (Execute maven Goal), select the module's directory, and then fill in the Install command, and then click Execute.
6, the execution of install, will also run the test class method, if the test class in the failure of the method, it will cause the module install failure, need to pay attention.