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

Source: Internet
Author: User
Tags log4j

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

Use dependencies to load the required jar packages into 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

Examples:

Typically only when you use spring, you will spring-context rely on the POM.

<dependency>        <groupId>org.springframework</groupId>        <artifactid>spring-context </artifactId>        <version>${org.springframework.version}</version></dependency>


For example, the following:

spring-contextWill take a look at the jar. Rely on their own initiative.

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 the schema. Its core is SPRINGMVC.
So first rely onspring-webmvc

<dependency>    <groupId>org.springframework</groupId>    <ARTIFACTID>SPRING-WEBMVC </artifactId>    <version>${org.springframework.version}</version></dependency>


Similarly, the spring-webmvc following jar packages are actively dependent on 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


For example, the following:

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>


In the same way, the spring-orm jar package is then actively dependent on project.

The following is the full 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 Loading: 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 on 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.