使用IDEA配置Maven搭建开发框架ssm教程
程序员文章站
2023-12-02 23:03:46
一、配置maven环境
1.下载maven
下载链接
2.下载完成解压压缩包并创建本地仓库文件夹
3.打开解压缩文件,配置本地仓库路径
4.配置m...
一、配置maven环境
1.下载maven
下载链接
2.下载完成解压压缩包并创建本地仓库文件夹
3.打开解压缩文件,配置本地仓库路径
4.配置maven环境变量
5.在cmd中查看maven是否配置正确
在cmd中输入mvn -v命令查看
二、在intellij idea中配置maven
打开-file-settings
三、新建maven javaweb项目
1.打开-file-new-project
next
next
添加的配置为 archetypecatalog=internal
next
点击finish完成
生成项目框架后,在 src/main 下创建 java目录。项目的工程结构如图。
四、配置项目框架文件
<?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.sourceencoding>utf-8</project.build.sourceencoding> <project.reporting.outputencoding>utf-8</project.reporting.outputencoding> <!-- spring版本号 --> <spring.version>4.2.5.release</spring.version> <!-- mybatis版本号 --> <mybatis.version>3.2.8</mybatis.version> <!-- mysql驱动版本号 --> <mysql-driver.version>5.1.29</mysql-driver.version> <!-- log4j日志包版本号 --> <slf4j.version>1.7.18</slf4j.version> <log4j.version>1.2.17</log4j.version> </properties> <dependencies> <!-- 添加jstl依赖 --> <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> <!-- 添加junit4依赖 --> <dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <version>4.11</version> <!-- 指定范围,在测试时才会加载 --> <scope>test</scope> </dependency> <!-- 添加spring核心依赖 --> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-core</artifactid> <version>${spring.version}</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-web</artifactid> <version>${spring.version}</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-oxm</artifactid> <version>${spring.version}</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-tx</artifactid> <version>${spring.version}</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-jdbc</artifactid> <version>${spring.version}</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-webmvc</artifactid> <version>${spring.version}</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-context</artifactid> <version>${spring.version}</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-context-support</artifactid> <version>${spring.version}</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-aop</artifactid> <version>${spring.version}</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-test</artifactid> <version>${spring.version}</version> </dependency> <!-- 添加mybatis依赖 --> <dependency> <groupid>org.mybatis</groupid> <artifactid>mybatis</artifactid> <version>${mybatis.version}</version> </dependency> <!-- 添加mybatis/spring整合包依赖 --> <dependency> <groupid>org.mybatis</groupid> <artifactid>mybatis-spring</artifactid> <version>1.2.2</version> </dependency> <!-- 添加mysql驱动依赖 --> <dependency> <groupid>mysql</groupid> <artifactid>mysql-connector-java</artifactid> <version>${mysql-driver.version}</version> </dependency> <!-- 添加数据库连接池依赖 --> <dependency> <groupid>commons-dbcp</groupid> <artifactid>commons-dbcp</artifactid> <version>1.2.2</version> </dependency> <!-- 添加fastjson --> <dependency> <groupid>com.alibaba</groupid> <artifactid>fastjson</artifactid> <version>1.1.41</version> </dependency> <!-- 添加日志相关jar包 --> <dependency> <groupid>log4j</groupid> <artifactid>log4j</artifactid> <version>${log4j.version}</version> </dependency> <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-api</artifactid> <version>${slf4j.version}</version> </dependency> <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-log4j12</artifactid> <version>${slf4j.version}</version> </dependency> <!-- log end --> <!-- 映入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> <dependency> <groupid>commons-fileupload</groupid> <artifactid>commons-fileupload</artifactid> <version>1.3.1</version> </dependency> <dependency> <groupid>commons-io</groupid> <artifactid>commons-io</artifactid> <version>2.4</version> </dependency> <dependency> <groupid>commons-codec</groupid> <artifactid>commons-codec</artifactid> <version>1.9</version> </dependency> </dependencies> <build> <finalname>web-ssm</finalname> </build> </project>
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
上一篇: 如何做好软文推广?满足用户的3种需求!
推荐阅读
-
使用IDEA配置Maven搭建开发框架ssm教程
-
在eclipse中使用Maven分模块搭建SSM框架,创建jar、war、pom工程模块教学,项目的热部署,需要的可以留下邮箱,给大家发整理过的Maven笔记
-
使用Idea和maven搭建Mybatis框架以及基础测试
-
使用IDEA搭建SSM框架的详细教程(spring + springMVC +MyBatis)
-
IDEA使用Maven搭建SSM框架
-
使用SSM框架开发applicationContext.xml和jdbc.properties配置文件的使用
-
教你使用idea搭建ssm详细教程(Spring+Spring Mvc+Mybatis)
-
在eclipse中使用Maven分模块搭建SSM框架,创建jar、war、pom工程模块教学,项目的热部署,需要的可以留下邮箱,给大家发整理过的Maven笔记
-
基于IDEA实现SSM整合框架的搭建配置流程
-
使用IDEA搭建SSM框架的详细教程(spring + springMVC +MyBatis)