使用IDEA配置Maven搭建开发框架ssm教程
作者:codeRose 时间:2023-04-05 13:33:21
使用IDEA配置Maven搭建开发框架ssm教程
一、配置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>
标签:IDEA,Maven,ssm
0
投稿
猜你喜欢
Android使用Sensor感应器实现线程中刷新UI创建android测力计的功能
2023-03-05 07:51:48
JAVA字符串占位符使用方法实例
2021-09-20 17:30:27
Android提高之自定义Menu(TabMenu)实现方法
2023-04-11 14:01:06
使用IDEA将Java/Kotliin工程导出Jar包的正确姿势
2022-10-18 17:39:34
Android多线程学习实例详解
2022-02-17 19:00:56
java8新特性将List中按指定属性排序过滤重复数据的方法
2023-06-16 17:57:42
关于Java整合RocketMQ实现生产消费详解
2022-12-31 07:44:34
Java 注解学习笔记
2022-12-25 02:40:54
详谈Java中的事件监听机制
2022-08-05 00:29:30
Android开发中ImageLoder加载网络图片时将图片设置为ImageView背景的方法
2021-12-14 14:58:38
解决Springboot @Autowired 无法注入问题
2022-04-14 21:19:01
android 实现侧边弹窗特效代码
2021-10-18 07:23:02
完整的iOS新浪微博分享功能开发
2023-06-24 14:14:08
SpringBoot2.6.x升级后循环依赖及Swagger无法使用问题
2021-12-02 09:49:43
Android中Xposed框架篇---修改系统位置信息实现自身隐藏功能实例
2023-10-15 21:40:37
winform中的ListBox和ComboBox绑定数据用法实例
2023-09-24 05:02:13
Java中的zookeeper常用命令详解
2022-12-07 05:46:35
c# 实现文件上传下载功能的实例代码
2021-12-10 15:00:30
Java IO流—异常及捕获异常处理 try…catch…finally
2023-03-14 07:35:52
Java动态规划方式解决不同的二叉搜索树
2023-03-02 01:56:52