创建Maven项目

1.下载Maven资源包

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

2.打开IDEA创建Maven项目

  在新建项目窗口选择Maven项目:检查当前SDK版本是否为最新版本。

配置Maven

1.修改Maven home directory的路径

  • File——Settings...打开设置

  • 搜索Maven
  • 改路径

搭建配置引入依赖:

    <dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.2.13.RELEASE</version>
</dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-beans -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>5.2.13.RELEASE</version>
</dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.2.13.RELEASE</version>
</dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-expression -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>5.2.13.RELEASE</version>
</dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-aop -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>5.2.13.RELEASE</version>
</dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-jcl -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jcl</artifactId>
<version>5.2.13.RELEASE</version>
</dependency> </dependencies>

刷新Maven

代码截屏:

1.接口类

2.实现类

3.实现接口

4.测试类的方法

5.测试结果

步骤:

1、新建UserService接口

2、新建UserService实现类

3、通过bean将UserService放入容器

4、通过context的getbean方法拿到UserService对象

最新文章

  1. 把office文档转换为html过程中的一些坑
  2. windows和linux之间“/”, &quot;\\&quot;的区别
  3. 专业上的常用的工具和类库集 By 老衣
  4. 初学SQL常用到的一些指令
  5. 会php不回缓存行吗?多重实现
  6. Android之ScaleGestureDetector(缩放手势检测)
  7. [读书笔记]算法(Sedgewick著)&#183;第二章.初级排序算法
  8. Orchard是一个了不起CMS(内容管理系统)
  9. java对数据库的操作
  10. Linux下进程间通信--共享内存:最快的进程间通信方式
  11. 尝试解决IDea 启动项目后,后台疯狂输出日志。
  12. 2018-软工机试-F-庙会
  13. 第一次:lesson eighty seven。
  14. Lucene源码
  15. 【题解】 bzoj1055: [HAOI2008]玩具取名 (动态规划)
  16. ECG心电图数据2
  17. 苏宁易购Android架构演进史
  18. 重构--去除丑陋的switch语句
  19. Lua库-bit32库
  20. C# 类反射创建对象实例

热门文章

  1. npm ci All In One
  2. Web 全栈开发 Redis 面试题
  3. 移动端 CSS 1px 问题及解决方案
  4. Azure 计费 &amp; 成本管理 &amp; 取消 Azure 订阅
  5. CSS Dark Mode
  6. 如何成为NGK超级节点?
  7. 安装vue脚手架
  8. js 表格插入指定行
  9. Spring Boot和Thymeleaf整合,结合JPA实现分页效果
  10. WPF权限控制框架——【4】抛砖引玉