Maven config Spring+springmvc+mybatis (3.2.2) Pom and IntelliJ idea how to open a dependent view

Source: Internet
Author: User

Maven configuration Spring+springmvc+mybatis (3.2.2) POM Configuration principle:

Use dependencies to load the required jar packages into the project.

    1. Rely on the main jar package first
      Spring + Spring MVC + MyBatis + database

    2. Rely on the secondary jar package again
      C3P0 Connection Pool, Log4j,junit

    3. 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-contextwill 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> &LT;GROUPID&GT;JAVAX.SERVLET.JSP.JSTL&LT;/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:
    1. View--Select Tools Buttons
    2. Click the Struture view on the left.
    3. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.