Maven configuration Spring+springmvc+mybatis (3.2.2) POM Configuration principle:
Use dependencies to load the required jar packages into the project.
Rely on the main jar package first
Spring + Spring MVC + MyBatis + database
Rely on the secondary jar package again
C3P0 Connection Pool, Log4j,junit
Peripheral Jar Package
POI Jfreecharts JXL
Example:
Typically only when spring is used, it is spring-context
dependent on the POM.
<dependency> <groupId>org.springframework</groupId> <artifactid>spring-context </artifactId> <version>${org.springframework.version}</version></dependency>
As follows:
spring-context
will automatically rely on the jar.
Commons-logging:1.1.1spring-aop:3.2.2.releasespring-beans:3.2.2.releasespring-context:3.2.2.releasespring-core : 3.2.2.releasespring-expression:3.2.2.release
Because this project uses Spring+springmvc+mybatis as its architecture, its core is SPRINGMVC.
So first rely onspring-webmvc
<dependency> <groupId>org.springframework</groupId> <ARTIFACTID>SPRING-WEBMVC </artifactId> <version>${org.springframework.version}</version></dependency>
In the same vein, the spring-webmvc
following jar packages are automatically dependent on the project.
Commons-logging:1.1.1spring-aop:3.2.2.releasespring-beans:3.2.2.releasespring-context:3.2.2.releasespring-core : 3.2.2.releasespring-expression:3.2.2.releasespring-web:3.2.2.releasespring-webmvc:3.2.2.release
As follows:
When using spring, the existence of a transaction is missing and the transaction is in spring-orm
, and will be spring-orm
dependent on the project
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm< /artifactid> <version>${org.springframework.version}</version> </dependency>
Similarly, the spring-orm
jar package will be automatically dependent on the project.
Here are all the Pom.xml file information for spring + SPRINGMVC + MyBatis + POI.
<properties><org.springframework.version>3.2.2.release</org.springframework.version></ Properties><dependencies><dependency> <groupId>org.springframework</groupId> < Artifactid>spring-webmvc</artifactid> <version>${org.springframework.version}</version> </dependency><dependency> <groupId>org.springframework</groupId> <artifactId> Spring-orm</artifactid> <version>${org.springframework.version}</version></dependency> <dependency> <groupId>org.springframework</groupId> <artifactid>spring-test</ artifactid> <version>${org.springframework.version}</version> <type>jar</type> <sco Pe>test</scope></dependency><dependency> <groupId>org.aspectj</groupId> < Artifactid>aspectjweaver</artifactid> <version>1.8.2</version></depeNdency><dependency> <groupId>org.mybatis</groupId> <artifactid>mybatis</artifactid > <version>3.2.2</version></dependency><dependency> <groupid>org.mybatis</ Groupid> <artifactId>mybatis-spring</artifactId> <version>1.2.0</version></ dependency><dependency> <groupId>c3p0</groupId> <artifactId>c3p0</artifactId> &L T;version>0.9.1.2</version></dependency><dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.31</version></dependency ><dependency> <!--cascade Load: log4j---<groupId>org.slf4j</groupId> <artifactid>slf4j -log4j12</artifactid> <version>1.6.1</version></dependency><dependency> < Groupid>org.apache.poi</groupid> <artifactid>poi</artifactid> <version>3.9</version></dependency><dependency> <groupId> Org.apache.poi</groupid> <artifactId>poi-ooxml</artifactId> <version>3.9</version> </dependency><dependency> <groupId>jfree</groupId> <artifactid>jfreechart</ Artifactid> <version>1.0.13</version></dependency><dependency> <groupid>junit </groupId> <artifactId>junit</artifactId> <version>4.9</version></dependency ><dependency> <groupId>commons-fileupload</groupId> <artifactid>commons-fileupload </artifactId> <version>1.2.2</version></dependency><dependency> <groupId> Commons-io</groupid> <artifactId>commons-io</artifactId> <version>2.0.1</version> </dependency><dependency> <GROUPID>JAVAX.SERVLET.JSP.JSTL</groupid> <artifactId>jstl-api</artifactId> <version>1.2</version></dependency ><dependency> <groupId>org.glassfish.web</groupId> <artifactid>jstl-impl</ Artifactid> <version>1.2</version></dependency><dependency> <groupid>jexcelapi </groupId> <artifactId>jxl</artifactId> <version>2.4.2</version></dependency ><dependency> <groupId>org.apache.tomcat</groupId> <artifactId>tomcat-servlet-api< /artifactid> <version>7.0.8</version> <scope>provided</scope></dependency>
Use IntelliJ idea to view the pom dependency view:
- View--Select Tools Buttons
- Click the Struture view on the left.
- In Project right--diagrams--Show Dependencies
All over. If in doubt, can leave a message Oh!
Maven config Spring+springmvc+mybatis (3.2.2) Pom and IntelliJ idea how to open a dependent view