Use IDEA to configure Maven to build the development framework ssm and mavenssm

Source: Internet
Author: User

Use IDEA to configure Maven to build the development framework ssm and mavenssm
1. Configure the Maven environment 1. Download Maven

Download link http://maven.apache.org/download.cgi

2. Download and decompress the package and create a local repository folder.

3. Open the decompression file and configure the local repository path

 

 

4. Configure Maven Environment Variables

 

 

5. Check whether maven is correctly configured in cmd.

Enter the mvn-v command in cmd to view

 

II, Configure Maven in IntelliJ IDEA

  Open-File-Settings

 

III, Create a maven JAVAWEB Project

 1. Open-File-New-Project

 

Next

Next

The added configuration is archetypeCatalog = internal.

Next

Click Finish.

After the project framework is generated, create a java directory under src/main. The project structure.

Iv. Configure the project framework File

 

<? Xml version = "1.0" encoding = "UTF-8"?> <Project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: schemaLocation = "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion> 4.0.0 </modelVersion> <groupId> com. cwp </groupId> <artifactId> ssmdemo01 </artifactId> <version> 1.0-SNAPSHOT </version> <url> http://maven.apache.org </url> <properties> <project. build. sour CeEncoding> UTF-8 </project. build. sourceEncoding> <project. reporting. outputEncoding> UTF-8 </project. reporting. outputEncoding> <! -- Spring version --> <spring. version> 4.2.5.RELEASE </spring. version> <! -- Mybatis version --> <mybatis. version> 3.2.8 </mybatis. version> <! -- Mysql driver version --> <mysql-driver.version> 5.1.29 </mysql-driver.version> <! -- Log4j log package version --> <slf4j. version> 1.7.18 </slf4j. version> <log4j. version> 1.2.17 </log4j. version> </properties> <dependencies> <! -- Add jstl dependency --> <dependency> <groupId> jstl </groupId> <artifactId> jstl </artifactId> <version> 1.2 </version> </dependency> <dependency> <groupId> javax </groupId> <artifactId> javaee-api </artifactId> <version> 7.0 </version> </dependency> <! -- Add junit4 dependency --> <dependency> <groupId> junit </groupId> <artifactId> junit </artifactId> <version> 4.11 </version> <! -- Specify a range. During the test, --> <scope> test </scope> </dependency> <! -- Add spring core dependency --> <dependency> <groupId> org. springframework </groupId> <artifactId> spring-core </artifactId> <version >$ {spring. version }</version> </dependency> <groupId> org. springframework </groupId> <artifactId> spring-web </artifactId> <version >$ {spring. version }</version> </dependency> <groupId> org. springframework </groupId> <artifactId> spring-oxm </artifactId> <version >$ {spr Ing. version }</version> </dependency> <groupId> org. springframework </groupId> <artifactId> spring-tx </artifactId> <version >$ {spring. version }</version> </dependency> <groupId> org. springframework </groupId> <artifactId> spring-jdbc </artifactId> <version >$ {spring. version }</version> </dependency> <groupId> org. springframework </groupId> <artifactId> spring-webmvc </artifa CtId> <version >$ {spring. version }</version> </dependency> <groupId> org. springframework </groupId> <artifactId> spring-context </artifactId> <version >$ {spring. version }</version> </dependency> <groupId> org. springframework </groupId> <artifactId> spring-context-support </artifactId> <version >$ {spring. version }</version> </dependency> <groupId> org. springframework </groupI D> <artifactId> spring-aop </artifactId> <version >$ {spring. version }</version> </dependency> <groupId> org. springframework </groupId> <artifactId> spring-test </artifactId> <version >$ {spring. version }</version> </dependency> <! -- Add mybatis dependency --> <dependency> <groupId> org. mybatis </groupId> <artifactId> mybatis </artifactId> <version >$ {mybatis. version }</version> </dependency> <! -- Add the dependency of mybatis/spring integration package --> <dependency> <groupId> org. mybatis </groupId> <artifactId> mybatis-spring </artifactId> <version> 1.2.2 </version> </dependency> <! -- Add mysql driver dependency --> <dependency> <groupId> mysql </groupId> <artifactId> mysql-connector-java </artifactId> <version >$ {mysql-driver.version} </version> </dependency> <! -- Add database connection pool dependencies --> <dependency> <groupId> commons-dbcp </groupId> <artifactId> commons-dbcp </artifactId> <version> 1.2.2 </version> </ dependency> <! -- Add fastjson --> <dependency> <groupId> com. alibaba </groupId> <artifactId> fastjson </artifactId> <version> 1.1.41 </version> </dependency> <! -- Add jar packages related to logs --> <dependency> <groupId> log4j </groupId> <artifactId> log4j </artifactId> <version >$ {log4j. version }</version> </dependency> <groupId> org. slf4j </groupId> <artifactId> slf4j-api </artifactId> <version >$ {slf4j. version }</version> </dependency> <groupId> org. slf4j </groupId> <artifactId> slf4j-log4j12 </artifactId> <version >$ {slf4j. version }</version> </dependency> <! -- Log end --> <! -- Returns JSON --> <dependency> <groupId> org. codehaus. jackson </groupId> <artifactId> jackson-mapper-asl </artifactId> <version> 1.9.13 </version> </dependency> <! -- Https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core --> <dependency> <groupId> com. fasterxml. jackson. core </groupId> <artifactId> jackson-core </artifactId> <version> 2.8.0 </version> </dependency> <! -- Https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind --> <dependency> <groupId> com. fasterxml. jackson. core </groupId> <artifactId> jackson-databind </artifactId> <version> 2.8.0 </version> </dependency> <groupId> commons-fileupload </groupId> <artifactId> commons-fileupload </artifactId> <version> 1.3.1 </version> </dependency> <groupId> commons-io </groupId> <artifactId> commons- io </artifactId> <version> 2.4 </version> </dependency> <groupId> commons-codec </groupId> <artifactId> commons-codec </artifactId> <version> 1.9 </version> </dependency> </dependencies> <build> <finalName> web-ssm </finalName> </build> </project>

Configure the project dependency jar package

Related Article

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.