IDEA教程视屏地址:

教程视屏地址:
https://www.bilibili.com/video/BV1XJ41117tT?from=search&seid=3428956832927583222
视屏非本人录制,侵删, 亲测可用

1.spring源码结构:(添加了一个OwnLearnSpring模块,用于学习测试)IDEA(Win10)搭建Spring5.1.x源码教程视频
2.小demo测试:
domeo目录结构:
IDEA(Win10)搭建Spring5.1.x源码教程视频
2-1:
package com.learn;

import org.springframework.context.annotation.ComponentScan;

@ComponentScan(“com.learn”)
public class Appconfig {
}
IDEA(Win10)搭建Spring5.1.x源码教程视频

2-2:
package com.learn;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class BuildTest {
public static void main(String[] args) {
AnnotationConfigApplicationContext annotationConfigApplicationContext=new AnnotationConfigApplicationContext(Appconfig.class);
System.out.println(“TestResult====>”+annotationConfigApplicationContext.getBean(BuildTestService.class));
}
}
IDEA(Win10)搭建Spring5.1.x源码教程视频

2-3:
package com.learn;

import org.springframework.stereotype.Service;

@Service
public class BuildTestService {
}
IDEA(Win10)搭建Spring5.1.x源码教程视频

2-4:
配置文件:
plugins {
id ‘java’
}

group ‘org.springframework’
version ‘5.1.15.BUILD-SNAPSHOT’

repositories {
mavenCentral()
}

dependencies {
compile(project(":spring-context"))
testCompile group: ‘junit’, name: ‘junit’, version: ‘4.12’
}
IDEA(Win10)搭建Spring5.1.x源码教程视频

3.demo测试成功IDEA(Win10)搭建Spring5.1.x源码教程视频

相关文章:

  • 2021-12-23
  • 2022-12-23
  • 2021-09-27
  • 2022-12-23
  • 2021-06-07
  • 2021-06-17
  • 2021-08-01
  • 2022-12-23
猜你喜欢
  • 2021-03-30
  • 2021-05-16
  • 2021-11-29
  • 2021-07-11
  • 2021-07-29
  • 2021-07-25
  • 2021-03-31
相关资源
相似解决方案