Spring 对 Junit4,Junit5 的支持上的运用

金歌  金牌会员 | 2024-5-21 01:44:36 | 显示全部楼层 | 阅读模式
打印 上一主题 下一主题

主题 928|帖子 928|积分 2784

1. Spring 对 Junit4,Junit5 的支持上的运用

@
目录

每博一文案
  1. 关于理想主义,在知乎上看到一句话:“他们并不是不懂别人口中的现实,他们只是不信,事情只能是现在这个样子。”
  2. <?xml version="1.0" encoding="UTF-8"?>
  3. <beans xmlns="http://www.springframework.org/schema/beans"
  4.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  5.        xmlns:context="http://www.springframework.org/schema/context"
  6.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  7.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  8.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  9. </beans> 错误的、肮脏的、混乱的、轻松自如的、自言尽力了,有人真的不懂么?为了利益和怠惰做出这样那样或好或坏的事情,什么动物都会。有人会开脱和找借口,说着现实就是如此啊,无力改变世界就改变自己啊。他们对现状摇摇头然后果断投入到漆黑的污水里去,义无反顾地。
  10. <?xml version="1.0" encoding="UTF-8"?>
  11. <beans xmlns="http://www.springframework.org/schema/beans"
  12.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  13.        xmlns:context="http://www.springframework.org/schema/context"
  14.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  15.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  16.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  17. </beans> 但理想主义者是不信的,他们先是在语言上画一个大问号,再用行动画一个大叹号。
  18. <?xml version="1.0" encoding="UTF-8"?>
  19. <beans xmlns="http://www.springframework.org/schema/beans"
  20.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  21.        xmlns:context="http://www.springframework.org/schema/context"
  22.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  23.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  24.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  25. </beans> 他先问你,怎么就非得这样不可?怎么就没了别的办法?然后再用做出来的事情告诉你,我告诉你就是还能有更干净、更温和、更有效的办法!
  26. <?xml version="1.0" encoding="UTF-8"?>
  27. <beans xmlns="http://www.springframework.org/schema/beans"
  28.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  29.        xmlns:context="http://www.springframework.org/schema/context"
  30.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  31.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  32.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  33. </beans> 他们自己也有不能一尘不染的时候。但他们看着满目漆黑也不信世界上就没有洁白、干净这回事。
  34. <?xml version="1.0" encoding="UTF-8"?>
  35. <beans xmlns="http://www.springframework.org/schema/beans"
  36.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  37.        xmlns:context="http://www.springframework.org/schema/context"
  38.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  39.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  40.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  41. </beans> 理想主义者就是不会相信生活和世界就是这样了。不管它是别人眼中的好,还是坏。
  42.    “一定有更好的办法,也能够通过合理的方式,缓慢地改善世界。愿意为了自己的理想而做些什么,甚至也愿意去牺牲什么。对于自己的手段、目的与认知,始终心怀疑问。即使做出的一切都看不到所谓的成效。即使这改变在活着的时候甚至也看不到。知道世界比较容易被忍受的这部分,是很多人用了很多代价换来的。但不会停下对好的东西的向往,还有向光明的地方行走的脚步。”
  43. <?xml version="1.0" encoding="UTF-8"?>
  44. <beans xmlns="http://www.springframework.org/schema/beans"
  45.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  46.        xmlns:context="http://www.springframework.org/schema/context"
  47.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  48.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  49.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  50. </beans> 这才算理想主义者吧。往往是重视精神价值超过物质利益。理想主义者把对精神价值的追求看作人生的主要追求,这些精神价值包括:尊严、正义、爱、美等等。
  51. <?xml version="1.0" encoding="UTF-8"?>
  52. <beans xmlns="http://www.springframework.org/schema/beans"
  53.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  54.        xmlns:context="http://www.springframework.org/schema/context"
  55.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  56.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  57.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  58. </beans>而浪漫主义,诺瓦利斯说过:
  59.    “在我看来,把普通的东西赋予崇高的意义,给平凡的东西披上神秘的外衣,使熟知的东西恢复未知的尊严,对有限的东西给予无限的外观,这就是浪漫化。反过来说,这就是变得崇高、未知、神秘和无限的过程,通过这种联系,这一浪漫化过程就会被对数化。它得到一个常用的表达:浪漫哲学。”
复制代码
2. Spring对Junit4 的支持

准备工作,先在pom.xml 文件当中,导入相关依赖的 jar 包信息,如下:
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"
  3. <?xml version="1.0" encoding="UTF-8"?>
  4. <beans xmlns="http://www.springframework.org/schema/beans"
  5.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  6.        xmlns:context="http://www.springframework.org/schema/context"
  7.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  8.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  9.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  10. </beans><?xml version="1.0" encoding="UTF-8"?>
  11. <beans xmlns="http://www.springframework.org/schema/beans"
  12.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  13.        xmlns:context="http://www.springframework.org/schema/context"
  14.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  15.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  16.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  17. </beans> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  18. <?xml version="1.0" encoding="UTF-8"?>
  19. <beans xmlns="http://www.springframework.org/schema/beans"
  20.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  21.        xmlns:context="http://www.springframework.org/schema/context"
  22.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  23.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  24.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  25. </beans><?xml version="1.0" encoding="UTF-8"?>
  26. <beans xmlns="http://www.springframework.org/schema/beans"
  27.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  28.        xmlns:context="http://www.springframework.org/schema/context"
  29.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  30.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  31.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  32. </beans> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  33. <?xml version="1.0" encoding="UTF-8"?>
  34. <beans xmlns="http://www.springframework.org/schema/beans"
  35.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  36.        xmlns:context="http://www.springframework.org/schema/context"
  37.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  38.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  39.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  40. </beans><modelVersion>4.0.0</modelVersion>
  41. <?xml version="1.0" encoding="UTF-8"?>
  42. <beans xmlns="http://www.springframework.org/schema/beans"
  43.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  44.        xmlns:context="http://www.springframework.org/schema/context"
  45.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  46.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  47.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  48. </beans><groupId>com.rainbowsea</groupId>
  49. <?xml version="1.0" encoding="UTF-8"?>
  50. <beans xmlns="http://www.springframework.org/schema/beans"
  51.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  52.        xmlns:context="http://www.springframework.org/schema/context"
  53.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  54.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  55.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  56. </beans><artifactId>spring6-015-junit</artifactId>
  57. <?xml version="1.0" encoding="UTF-8"?>
  58. <beans xmlns="http://www.springframework.org/schema/beans"
  59.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  60.        xmlns:context="http://www.springframework.org/schema/context"
  61.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  62.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  63.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  64. </beans><version>1.0-SNAPSHOT</version>
  65. <?xml version="1.0" encoding="UTF-8"?>
  66. <beans xmlns="http://www.springframework.org/schema/beans"
  67.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  68.        xmlns:context="http://www.springframework.org/schema/context"
  69.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  70.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  71.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  72. </beans><packaging>jar</packaging>
  73. <?xml version="1.0" encoding="UTF-8"?>
  74. <beans xmlns="http://www.springframework.org/schema/beans"
  75.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  76.        xmlns:context="http://www.springframework.org/schema/context"
  77.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  78.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  79.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  80. </beans><properties>
  81. <?xml version="1.0" encoding="UTF-8"?>
  82. <beans xmlns="http://www.springframework.org/schema/beans"
  83.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  84.        xmlns:context="http://www.springframework.org/schema/context"
  85.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  86.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  87.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  88. </beans><?xml version="1.0" encoding="UTF-8"?>
  89. <beans xmlns="http://www.springframework.org/schema/beans"
  90.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  91.        xmlns:context="http://www.springframework.org/schema/context"
  92.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  93.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  94.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  95. </beans><maven.compiler.source>17</maven.compiler.source>
  96. <?xml version="1.0" encoding="UTF-8"?>
  97. <beans xmlns="http://www.springframework.org/schema/beans"
  98.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  99.        xmlns:context="http://www.springframework.org/schema/context"
  100.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  101.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  102.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  103. </beans><?xml version="1.0" encoding="UTF-8"?>
  104. <beans xmlns="http://www.springframework.org/schema/beans"
  105.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  106.        xmlns:context="http://www.springframework.org/schema/context"
  107.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  108.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  109.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  110. </beans><maven.compiler.target>17</maven.compiler.target>
  111. <?xml version="1.0" encoding="UTF-8"?>
  112. <beans xmlns="http://www.springframework.org/schema/beans"
  113.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  114.        xmlns:context="http://www.springframework.org/schema/context"
  115.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  116.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  117.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  118. </beans></properties>
  119. <?xml version="1.0" encoding="UTF-8"?>
  120. <beans xmlns="http://www.springframework.org/schema/beans"
  121.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  122.        xmlns:context="http://www.springframework.org/schema/context"
  123.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  124.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  125.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  126. </beans>
  127. <?xml version="1.0" encoding="UTF-8"?>
  128. <beans xmlns="http://www.springframework.org/schema/beans"
  129.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  130.        xmlns:context="http://www.springframework.org/schema/context"
  131.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  132.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  133.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  134. </beans><repositories>
  135. <?xml version="1.0" encoding="UTF-8"?>
  136. <beans xmlns="http://www.springframework.org/schema/beans"
  137.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  138.        xmlns:context="http://www.springframework.org/schema/context"
  139.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  140.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  141.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  142. </beans><?xml version="1.0" encoding="UTF-8"?>
  143. <beans xmlns="http://www.springframework.org/schema/beans"
  144.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  145.        xmlns:context="http://www.springframework.org/schema/context"
  146.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  147.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  148.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  149. </beans>
  150. <?xml version="1.0" encoding="UTF-8"?>
  151. <beans xmlns="http://www.springframework.org/schema/beans"
  152.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  153.        xmlns:context="http://www.springframework.org/schema/context"
  154.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  155.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  156.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  157. </beans><?xml version="1.0" encoding="UTF-8"?>
  158. <beans xmlns="http://www.springframework.org/schema/beans"
  159.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  160.        xmlns:context="http://www.springframework.org/schema/context"
  161.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  162.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  163.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  164. </beans><repository>
  165. <?xml version="1.0" encoding="UTF-8"?>
  166. <beans xmlns="http://www.springframework.org/schema/beans"
  167.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  168.        xmlns:context="http://www.springframework.org/schema/context"
  169.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  170.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  171.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  172. </beans><?xml version="1.0" encoding="UTF-8"?>
  173. <beans xmlns="http://www.springframework.org/schema/beans"
  174.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  175.        xmlns:context="http://www.springframework.org/schema/context"
  176.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  177.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  178.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  179. </beans><?xml version="1.0" encoding="UTF-8"?>
  180. <beans xmlns="http://www.springframework.org/schema/beans"
  181.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  182.        xmlns:context="http://www.springframework.org/schema/context"
  183.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  184.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  185.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  186. </beans><id>repository.spring.milestone</id>
  187. <?xml version="1.0" encoding="UTF-8"?>
  188. <beans xmlns="http://www.springframework.org/schema/beans"
  189.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  190.        xmlns:context="http://www.springframework.org/schema/context"
  191.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  192.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  193.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  194. </beans><?xml version="1.0" encoding="UTF-8"?>
  195. <beans xmlns="http://www.springframework.org/schema/beans"
  196.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  197.        xmlns:context="http://www.springframework.org/schema/context"
  198.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  199.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  200.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  201. </beans><?xml version="1.0" encoding="UTF-8"?>
  202. <beans xmlns="http://www.springframework.org/schema/beans"
  203.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  204.        xmlns:context="http://www.springframework.org/schema/context"
  205.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  206.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  207.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  208. </beans><name>Spring Milestone Repository</name>
  209. <?xml version="1.0" encoding="UTF-8"?>
  210. <beans xmlns="http://www.springframework.org/schema/beans"
  211.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  212.        xmlns:context="http://www.springframework.org/schema/context"
  213.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  214.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  215.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  216. </beans><?xml version="1.0" encoding="UTF-8"?>
  217. <beans xmlns="http://www.springframework.org/schema/beans"
  218.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  219.        xmlns:context="http://www.springframework.org/schema/context"
  220.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  221.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  222.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  223. </beans><?xml version="1.0" encoding="UTF-8"?>
  224. <beans xmlns="http://www.springframework.org/schema/beans"
  225.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  226.        xmlns:context="http://www.springframework.org/schema/context"
  227.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  228.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  229.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  230. </beans><url>https://repo.spring.io/milestone</url>
  231. <?xml version="1.0" encoding="UTF-8"?>
  232. <beans xmlns="http://www.springframework.org/schema/beans"
  233.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  234.        xmlns:context="http://www.springframework.org/schema/context"
  235.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  236.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  237.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  238. </beans><?xml version="1.0" encoding="UTF-8"?>
  239. <beans xmlns="http://www.springframework.org/schema/beans"
  240.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  241.        xmlns:context="http://www.springframework.org/schema/context"
  242.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  243.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  244.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  245. </beans></repository>
  246. <?xml version="1.0" encoding="UTF-8"?>
  247. <beans xmlns="http://www.springframework.org/schema/beans"
  248.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  249.        xmlns:context="http://www.springframework.org/schema/context"
  250.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  251.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  252.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  253. </beans></repositories>
  254. <?xml version="1.0" encoding="UTF-8"?>
  255. <beans xmlns="http://www.springframework.org/schema/beans"
  256.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  257.        xmlns:context="http://www.springframework.org/schema/context"
  258.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  259.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  260.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  261. </beans><dependencies>
  262. <?xml version="1.0" encoding="UTF-8"?>
  263. <beans xmlns="http://www.springframework.org/schema/beans"
  264.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  265.        xmlns:context="http://www.springframework.org/schema/context"
  266.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  267.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  268.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  269. </beans><?xml version="1.0" encoding="UTF-8"?>
  270. <beans xmlns="http://www.springframework.org/schema/beans"
  271.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  272.        xmlns:context="http://www.springframework.org/schema/context"
  273.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  274.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  275.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  276. </beans>
  277. <?xml version="1.0" encoding="UTF-8"?>
  278. <beans xmlns="http://www.springframework.org/schema/beans"
  279.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  280.        xmlns:context="http://www.springframework.org/schema/context"
  281.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  282.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  283.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  284. </beans><?xml version="1.0" encoding="UTF-8"?>
  285. <beans xmlns="http://www.springframework.org/schema/beans"
  286.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  287.        xmlns:context="http://www.springframework.org/schema/context"
  288.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  289.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  290.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  291. </beans><dependency>
  292. <?xml version="1.0" encoding="UTF-8"?>
  293. <beans xmlns="http://www.springframework.org/schema/beans"
  294.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  295.        xmlns:context="http://www.springframework.org/schema/context"
  296.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  297.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  298.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  299. </beans><?xml version="1.0" encoding="UTF-8"?>
  300. <beans xmlns="http://www.springframework.org/schema/beans"
  301.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  302.        xmlns:context="http://www.springframework.org/schema/context"
  303.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  304.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  305.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  306. </beans><?xml version="1.0" encoding="UTF-8"?>
  307. <beans xmlns="http://www.springframework.org/schema/beans"
  308.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  309.        xmlns:context="http://www.springframework.org/schema/context"
  310.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  311.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  312.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  313. </beans><groupId>org.springframework</groupId>
  314. <?xml version="1.0" encoding="UTF-8"?>
  315. <beans xmlns="http://www.springframework.org/schema/beans"
  316.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  317.        xmlns:context="http://www.springframework.org/schema/context"
  318.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  319.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  320.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  321. </beans><?xml version="1.0" encoding="UTF-8"?>
  322. <beans xmlns="http://www.springframework.org/schema/beans"
  323.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  324.        xmlns:context="http://www.springframework.org/schema/context"
  325.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  326.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  327.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  328. </beans><?xml version="1.0" encoding="UTF-8"?>
  329. <beans xmlns="http://www.springframework.org/schema/beans"
  330.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  331.        xmlns:context="http://www.springframework.org/schema/context"
  332.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  333.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  334.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  335. </beans><artifactId>spring-context</artifactId>
  336. <?xml version="1.0" encoding="UTF-8"?>
  337. <beans xmlns="http://www.springframework.org/schema/beans"
  338.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  339.        xmlns:context="http://www.springframework.org/schema/context"
  340.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  341.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  342.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  343. </beans><?xml version="1.0" encoding="UTF-8"?>
  344. <beans xmlns="http://www.springframework.org/schema/beans"
  345.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  346.        xmlns:context="http://www.springframework.org/schema/context"
  347.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  348.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  349.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  350. </beans><?xml version="1.0" encoding="UTF-8"?>
  351. <beans xmlns="http://www.springframework.org/schema/beans"
  352.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  353.        xmlns:context="http://www.springframework.org/schema/context"
  354.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  355.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  356.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  357. </beans><version>6.0.11</version>
  358. <?xml version="1.0" encoding="UTF-8"?>
  359. <beans xmlns="http://www.springframework.org/schema/beans"
  360.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  361.        xmlns:context="http://www.springframework.org/schema/context"
  362.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  363.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  364.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  365. </beans><?xml version="1.0" encoding="UTF-8"?>
  366. <beans xmlns="http://www.springframework.org/schema/beans"
  367.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  368.        xmlns:context="http://www.springframework.org/schema/context"
  369.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  370.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  371.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  372. </beans></dependency>
  373. <?xml version="1.0" encoding="UTF-8"?>
  374. <beans xmlns="http://www.springframework.org/schema/beans"
  375.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  376.        xmlns:context="http://www.springframework.org/schema/context"
  377.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  378.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  379.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  380. </beans><?xml version="1.0" encoding="UTF-8"?>
  381. <beans xmlns="http://www.springframework.org/schema/beans"
  382.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  383.        xmlns:context="http://www.springframework.org/schema/context"
  384.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  385.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  386.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  387. </beans>
  388. <?xml version="1.0" encoding="UTF-8"?>
  389. <beans xmlns="http://www.springframework.org/schema/beans"
  390.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  391.        xmlns:context="http://www.springframework.org/schema/context"
  392.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  393.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  394.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  395. </beans><?xml version="1.0" encoding="UTF-8"?>
  396. <beans xmlns="http://www.springframework.org/schema/beans"
  397.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  398.        xmlns:context="http://www.springframework.org/schema/context"
  399.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  400.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  401.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  402. </beans>
  403. <?xml version="1.0" encoding="UTF-8"?>
  404. <beans xmlns="http://www.springframework.org/schema/beans"
  405.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  406.        xmlns:context="http://www.springframework.org/schema/context"
  407.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  408.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  409.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  410. </beans><?xml version="1.0" encoding="UTF-8"?>
  411. <beans xmlns="http://www.springframework.org/schema/beans"
  412.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  413.        xmlns:context="http://www.springframework.org/schema/context"
  414.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  415.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  416.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  417. </beans><dependency>
  418. <?xml version="1.0" encoding="UTF-8"?>
  419. <beans xmlns="http://www.springframework.org/schema/beans"
  420.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  421.        xmlns:context="http://www.springframework.org/schema/context"
  422.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  423.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  424.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  425. </beans><?xml version="1.0" encoding="UTF-8"?>
  426. <beans xmlns="http://www.springframework.org/schema/beans"
  427.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  428.        xmlns:context="http://www.springframework.org/schema/context"
  429.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  430.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  431.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  432. </beans><?xml version="1.0" encoding="UTF-8"?>
  433. <beans xmlns="http://www.springframework.org/schema/beans"
  434.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  435.        xmlns:context="http://www.springframework.org/schema/context"
  436.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  437.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  438.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  439. </beans><groupId>org.springframework</groupId>
  440. <?xml version="1.0" encoding="UTF-8"?>
  441. <beans xmlns="http://www.springframework.org/schema/beans"
  442.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  443.        xmlns:context="http://www.springframework.org/schema/context"
  444.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  445.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  446.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  447. </beans><?xml version="1.0" encoding="UTF-8"?>
  448. <beans xmlns="http://www.springframework.org/schema/beans"
  449.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  450.        xmlns:context="http://www.springframework.org/schema/context"
  451.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  452.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  453.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  454. </beans><?xml version="1.0" encoding="UTF-8"?>
  455. <beans xmlns="http://www.springframework.org/schema/beans"
  456.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  457.        xmlns:context="http://www.springframework.org/schema/context"
  458.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  459.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  460.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  461. </beans><artifactId>spring-test</artifactId>
  462. <?xml version="1.0" encoding="UTF-8"?>
  463. <beans xmlns="http://www.springframework.org/schema/beans"
  464.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  465.        xmlns:context="http://www.springframework.org/schema/context"
  466.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  467.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  468.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  469. </beans><?xml version="1.0" encoding="UTF-8"?>
  470. <beans xmlns="http://www.springframework.org/schema/beans"
  471.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  472.        xmlns:context="http://www.springframework.org/schema/context"
  473.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  474.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  475.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  476. </beans><?xml version="1.0" encoding="UTF-8"?>
  477. <beans xmlns="http://www.springframework.org/schema/beans"
  478.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  479.        xmlns:context="http://www.springframework.org/schema/context"
  480.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  481.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  482.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  483. </beans>
  484. <?xml version="1.0" encoding="UTF-8"?>
  485. <beans xmlns="http://www.springframework.org/schema/beans"
  486.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  487.        xmlns:context="http://www.springframework.org/schema/context"
  488.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  489.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  490.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  491. </beans><?xml version="1.0" encoding="UTF-8"?>
  492. <beans xmlns="http://www.springframework.org/schema/beans"
  493.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  494.        xmlns:context="http://www.springframework.org/schema/context"
  495.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  496.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  497.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  498. </beans><?xml version="1.0" encoding="UTF-8"?>
  499. <beans xmlns="http://www.springframework.org/schema/beans"
  500.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  501.        xmlns:context="http://www.springframework.org/schema/context"
  502.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  503.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  504.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  505. </beans><version>6.0.11</version>
  506. <?xml version="1.0" encoding="UTF-8"?>
  507. <beans xmlns="http://www.springframework.org/schema/beans"
  508.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  509.        xmlns:context="http://www.springframework.org/schema/context"
  510.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  511.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  512.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  513. </beans><?xml version="1.0" encoding="UTF-8"?>
  514. <beans xmlns="http://www.springframework.org/schema/beans"
  515.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  516.        xmlns:context="http://www.springframework.org/schema/context"
  517.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  518.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  519.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  520. </beans></dependency>
  521. <?xml version="1.0" encoding="UTF-8"?>
  522. <beans xmlns="http://www.springframework.org/schema/beans"
  523.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  524.        xmlns:context="http://www.springframework.org/schema/context"
  525.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  526.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  527.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  528. </beans><?xml version="1.0" encoding="UTF-8"?>
  529. <beans xmlns="http://www.springframework.org/schema/beans"
  530.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  531.        xmlns:context="http://www.springframework.org/schema/context"
  532.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  533.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  534.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  535. </beans>
  536. <?xml version="1.0" encoding="UTF-8"?>
  537. <beans xmlns="http://www.springframework.org/schema/beans"
  538.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  539.        xmlns:context="http://www.springframework.org/schema/context"
  540.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  541.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  542.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  543. </beans><?xml version="1.0" encoding="UTF-8"?>
  544. <beans xmlns="http://www.springframework.org/schema/beans"
  545.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  546.        xmlns:context="http://www.springframework.org/schema/context"
  547.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  548.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  549.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  550. </beans><dependency>
  551. <?xml version="1.0" encoding="UTF-8"?>
  552. <beans xmlns="http://www.springframework.org/schema/beans"
  553.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  554.        xmlns:context="http://www.springframework.org/schema/context"
  555.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  556.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  557.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  558. </beans><?xml version="1.0" encoding="UTF-8"?>
  559. <beans xmlns="http://www.springframework.org/schema/beans"
  560.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  561.        xmlns:context="http://www.springframework.org/schema/context"
  562.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  563.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  564.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  565. </beans><?xml version="1.0" encoding="UTF-8"?>
  566. <beans xmlns="http://www.springframework.org/schema/beans"
  567.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  568.        xmlns:context="http://www.springframework.org/schema/context"
  569.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  570.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  571.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  572. </beans><groupId>junit</groupId>
  573. <?xml version="1.0" encoding="UTF-8"?>
  574. <beans xmlns="http://www.springframework.org/schema/beans"
  575.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  576.        xmlns:context="http://www.springframework.org/schema/context"
  577.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  578.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  579.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  580. </beans><?xml version="1.0" encoding="UTF-8"?>
  581. <beans xmlns="http://www.springframework.org/schema/beans"
  582.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  583.        xmlns:context="http://www.springframework.org/schema/context"
  584.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  585.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  586.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  587. </beans><?xml version="1.0" encoding="UTF-8"?>
  588. <beans xmlns="http://www.springframework.org/schema/beans"
  589.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  590.        xmlns:context="http://www.springframework.org/schema/context"
  591.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  592.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  593.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  594. </beans><artifactId>junit</artifactId>
  595. <?xml version="1.0" encoding="UTF-8"?>
  596. <beans xmlns="http://www.springframework.org/schema/beans"
  597.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  598.        xmlns:context="http://www.springframework.org/schema/context"
  599.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  600.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  601.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  602. </beans><?xml version="1.0" encoding="UTF-8"?>
  603. <beans xmlns="http://www.springframework.org/schema/beans"
  604.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  605.        xmlns:context="http://www.springframework.org/schema/context"
  606.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  607.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  608.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  609. </beans><?xml version="1.0" encoding="UTF-8"?>
  610. <beans xmlns="http://www.springframework.org/schema/beans"
  611.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  612.        xmlns:context="http://www.springframework.org/schema/context"
  613.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  614.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  615.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  616. </beans><version>4.13.2</version>
  617. <?xml version="1.0" encoding="UTF-8"?>
  618. <beans xmlns="http://www.springframework.org/schema/beans"
  619.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  620.        xmlns:context="http://www.springframework.org/schema/context"
  621.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  622.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  623.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  624. </beans><?xml version="1.0" encoding="UTF-8"?>
  625. <beans xmlns="http://www.springframework.org/schema/beans"
  626.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  627.        xmlns:context="http://www.springframework.org/schema/context"
  628.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  629.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  630.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  631. </beans><?xml version="1.0" encoding="UTF-8"?>
  632. <beans xmlns="http://www.springframework.org/schema/beans"
  633.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  634.        xmlns:context="http://www.springframework.org/schema/context"
  635.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  636.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  637.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  638. </beans><scope>test</scope>
  639. <?xml version="1.0" encoding="UTF-8"?>
  640. <beans xmlns="http://www.springframework.org/schema/beans"
  641.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  642.        xmlns:context="http://www.springframework.org/schema/context"
  643.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  644.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  645.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  646. </beans><?xml version="1.0" encoding="UTF-8"?>
  647. <beans xmlns="http://www.springframework.org/schema/beans"
  648.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  649.        xmlns:context="http://www.springframework.org/schema/context"
  650.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  651.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  652.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  653. </beans></dependency>
  654. <?xml version="1.0" encoding="UTF-8"?>
  655. <beans xmlns="http://www.springframework.org/schema/beans"
  656.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  657.        xmlns:context="http://www.springframework.org/schema/context"
  658.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  659.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  660.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  661. </beans><?xml version="1.0" encoding="UTF-8"?>
  662. <beans xmlns="http://www.springframework.org/schema/beans"
  663.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  664.        xmlns:context="http://www.springframework.org/schema/context"
  665.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  666.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  667.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  668. </beans>
  669. <?xml version="1.0" encoding="UTF-8"?>
  670. <beans xmlns="http://www.springframework.org/schema/beans"
  671.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  672.        xmlns:context="http://www.springframework.org/schema/context"
  673.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  674.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  675.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  676. </beans><?xml version="1.0" encoding="UTF-8"?>
  677. <beans xmlns="http://www.springframework.org/schema/beans"
  678.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  679.        xmlns:context="http://www.springframework.org/schema/context"
  680.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  681.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  682.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  683. </beans><dependency>
  684. <?xml version="1.0" encoding="UTF-8"?>
  685. <beans xmlns="http://www.springframework.org/schema/beans"
  686.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  687.        xmlns:context="http://www.springframework.org/schema/context"
  688.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  689.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  690.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  691. </beans><?xml version="1.0" encoding="UTF-8"?>
  692. <beans xmlns="http://www.springframework.org/schema/beans"
  693.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  694.        xmlns:context="http://www.springframework.org/schema/context"
  695.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  696.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  697.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  698. </beans><?xml version="1.0" encoding="UTF-8"?>
  699. <beans xmlns="http://www.springframework.org/schema/beans"
  700.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  701.        xmlns:context="http://www.springframework.org/schema/context"
  702.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  703.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  704.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  705. </beans><groupId>jakarta.annotation</groupId>
  706. <?xml version="1.0" encoding="UTF-8"?>
  707. <beans xmlns="http://www.springframework.org/schema/beans"
  708.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  709.        xmlns:context="http://www.springframework.org/schema/context"
  710.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  711.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  712.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  713. </beans><?xml version="1.0" encoding="UTF-8"?>
  714. <beans xmlns="http://www.springframework.org/schema/beans"
  715.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  716.        xmlns:context="http://www.springframework.org/schema/context"
  717.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  718.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  719.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  720. </beans><?xml version="1.0" encoding="UTF-8"?>
  721. <beans xmlns="http://www.springframework.org/schema/beans"
  722.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  723.        xmlns:context="http://www.springframework.org/schema/context"
  724.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  725.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  726.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  727. </beans><artifactId>jakarta.annotation-api</artifactId>
  728. <?xml version="1.0" encoding="UTF-8"?>
  729. <beans xmlns="http://www.springframework.org/schema/beans"
  730.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  731.        xmlns:context="http://www.springframework.org/schema/context"
  732.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  733.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  734.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  735. </beans><?xml version="1.0" encoding="UTF-8"?>
  736. <beans xmlns="http://www.springframework.org/schema/beans"
  737.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  738.        xmlns:context="http://www.springframework.org/schema/context"
  739.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  740.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  741.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  742. </beans><?xml version="1.0" encoding="UTF-8"?>
  743. <beans xmlns="http://www.springframework.org/schema/beans"
  744.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  745.        xmlns:context="http://www.springframework.org/schema/context"
  746.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  747.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  748.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  749. </beans><version>2.1.1</version>
  750. <?xml version="1.0" encoding="UTF-8"?>
  751. <beans xmlns="http://www.springframework.org/schema/beans"
  752.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  753.        xmlns:context="http://www.springframework.org/schema/context"
  754.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  755.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  756.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  757. </beans><?xml version="1.0" encoding="UTF-8"?>
  758. <beans xmlns="http://www.springframework.org/schema/beans"
  759.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  760.        xmlns:context="http://www.springframework.org/schema/context"
  761.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  762.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  763.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  764. </beans></dependency>
  765. <?xml version="1.0" encoding="UTF-8"?>
  766. <beans xmlns="http://www.springframework.org/schema/beans"
  767.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  768.        xmlns:context="http://www.springframework.org/schema/context"
  769.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  770.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  771.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  772. </beans></dependencies>
  773. </project>
复制代码
准备好,对于的 Bean 对象用于测试:留意:必要将其 Bean 对象纳入到 Spring IOC 容器当中进行管理上。
  1. package com.rainbowsea.spring6.bean;
  2. import org.springframework.beans.factory.annotation.Value;
  3. import org.springframework.stereotype.Component;
  4. @Component(value = "user")   // 交给 Spirng IOC 容器管理
  5. public class User {
  6. <?xml version="1.0" encoding="UTF-8"?>
  7. <beans xmlns="http://www.springframework.org/schema/beans"
  8.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  9.        xmlns:context="http://www.springframework.org/schema/context"
  10.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  11.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  12.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  13. </beans>@Value("张三") // spring 当中 value()注解简单类型的,set注入,赋值
  14. <?xml version="1.0" encoding="UTF-8"?>
  15. <beans xmlns="http://www.springframework.org/schema/beans"
  16.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  17.        xmlns:context="http://www.springframework.org/schema/context"
  18.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  19.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  20.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  21. </beans>private String name;
  22. <?xml version="1.0" encoding="UTF-8"?>
  23. <beans xmlns="http://www.springframework.org/schema/beans"
  24.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  25.        xmlns:context="http://www.springframework.org/schema/context"
  26.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  27.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  28.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  29. </beans>public User(String name) {
  30. <?xml version="1.0" encoding="UTF-8"?>
  31. <beans xmlns="http://www.springframework.org/schema/beans"
  32.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  33.        xmlns:context="http://www.springframework.org/schema/context"
  34.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  35.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  36.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  37. </beans><?xml version="1.0" encoding="UTF-8"?>
  38. <beans xmlns="http://www.springframework.org/schema/beans"
  39.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  40.        xmlns:context="http://www.springframework.org/schema/context"
  41.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  42.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  43.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  44. </beans>this.name = name;
  45. <?xml version="1.0" encoding="UTF-8"?>
  46. <beans xmlns="http://www.springframework.org/schema/beans"
  47.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  48.        xmlns:context="http://www.springframework.org/schema/context"
  49.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  50.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  51.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  52. </beans>}
  53. <?xml version="1.0" encoding="UTF-8"?>
  54. <beans xmlns="http://www.springframework.org/schema/beans"
  55.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  56.        xmlns:context="http://www.springframework.org/schema/context"
  57.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  58.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  59.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  60. </beans>public User() {
  61. <?xml version="1.0" encoding="UTF-8"?>
  62. <beans xmlns="http://www.springframework.org/schema/beans"
  63.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  64.        xmlns:context="http://www.springframework.org/schema/context"
  65.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  66.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  67.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  68. </beans>}
  69. <?xml version="1.0" encoding="UTF-8"?>
  70. <beans xmlns="http://www.springframework.org/schema/beans"
  71.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  72.        xmlns:context="http://www.springframework.org/schema/context"
  73.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  74.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  75.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  76. </beans>@Override
  77. <?xml version="1.0" encoding="UTF-8"?>
  78. <beans xmlns="http://www.springframework.org/schema/beans"
  79.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  80.        xmlns:context="http://www.springframework.org/schema/context"
  81.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  82.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  83.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  84. </beans>public String toString() {
  85. <?xml version="1.0" encoding="UTF-8"?>
  86. <beans xmlns="http://www.springframework.org/schema/beans"
  87.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  88.        xmlns:context="http://www.springframework.org/schema/context"
  89.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  90.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  91.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  92. </beans><?xml version="1.0" encoding="UTF-8"?>
  93. <beans xmlns="http://www.springframework.org/schema/beans"
  94.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  95.        xmlns:context="http://www.springframework.org/schema/context"
  96.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  97.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  98.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  99. </beans>return "User{" +
  100. <?xml version="1.0" encoding="UTF-8"?>
  101. <beans xmlns="http://www.springframework.org/schema/beans"
  102.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  103.        xmlns:context="http://www.springframework.org/schema/context"
  104.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  105.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  106.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  107. </beans><?xml version="1.0" encoding="UTF-8"?>
  108. <beans xmlns="http://www.springframework.org/schema/beans"
  109.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  110.        xmlns:context="http://www.springframework.org/schema/context"
  111.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  112.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  113.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  114. </beans><?xml version="1.0" encoding="UTF-8"?>
  115. <beans xmlns="http://www.springframework.org/schema/beans"
  116.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  117.        xmlns:context="http://www.springframework.org/schema/context"
  118.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  119.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  120.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  121. </beans><?xml version="1.0" encoding="UTF-8"?>
  122. <beans xmlns="http://www.springframework.org/schema/beans"
  123.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  124.        xmlns:context="http://www.springframework.org/schema/context"
  125.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  126.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  127.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  128. </beans>"name='" + name + '\'' +
  129. <?xml version="1.0" encoding="UTF-8"?>
  130. <beans xmlns="http://www.springframework.org/schema/beans"
  131.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  132.        xmlns:context="http://www.springframework.org/schema/context"
  133.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  134.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  135.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  136. </beans><?xml version="1.0" encoding="UTF-8"?>
  137. <beans xmlns="http://www.springframework.org/schema/beans"
  138.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  139.        xmlns:context="http://www.springframework.org/schema/context"
  140.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  141.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  142.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  143. </beans><?xml version="1.0" encoding="UTF-8"?>
  144. <beans xmlns="http://www.springframework.org/schema/beans"
  145.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  146.        xmlns:context="http://www.springframework.org/schema/context"
  147.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  148.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  149.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  150. </beans><?xml version="1.0" encoding="UTF-8"?>
  151. <beans xmlns="http://www.springframework.org/schema/beans"
  152.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  153.        xmlns:context="http://www.springframework.org/schema/context"
  154.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  155.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  156.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  157. </beans>'}';
  158. <?xml version="1.0" encoding="UTF-8"?>
  159. <beans xmlns="http://www.springframework.org/schema/beans"
  160.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  161.        xmlns:context="http://www.springframework.org/schema/context"
  162.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  163.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  164.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  165. </beans>}
  166. <?xml version="1.0" encoding="UTF-8"?>
  167. <beans xmlns="http://www.springframework.org/schema/beans"
  168.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  169.        xmlns:context="http://www.springframework.org/schema/context"
  170.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  171.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  172.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  173. </beans>public String getName() {
  174. <?xml version="1.0" encoding="UTF-8"?>
  175. <beans xmlns="http://www.springframework.org/schema/beans"
  176.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  177.        xmlns:context="http://www.springframework.org/schema/context"
  178.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  179.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  180.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  181. </beans><?xml version="1.0" encoding="UTF-8"?>
  182. <beans xmlns="http://www.springframework.org/schema/beans"
  183.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  184.        xmlns:context="http://www.springframework.org/schema/context"
  185.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  186.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  187.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  188. </beans>return name;
  189. <?xml version="1.0" encoding="UTF-8"?>
  190. <beans xmlns="http://www.springframework.org/schema/beans"
  191.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  192.        xmlns:context="http://www.springframework.org/schema/context"
  193.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  194.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  195.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  196. </beans>}
  197. <?xml version="1.0" encoding="UTF-8"?>
  198. <beans xmlns="http://www.springframework.org/schema/beans"
  199.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  200.        xmlns:context="http://www.springframework.org/schema/context"
  201.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  202.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  203.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  204. </beans>public void setName(String name) {
  205. <?xml version="1.0" encoding="UTF-8"?>
  206. <beans xmlns="http://www.springframework.org/schema/beans"
  207.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  208.        xmlns:context="http://www.springframework.org/schema/context"
  209.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  210.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  211.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  212. </beans><?xml version="1.0" encoding="UTF-8"?>
  213. <beans xmlns="http://www.springframework.org/schema/beans"
  214.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  215.        xmlns:context="http://www.springframework.org/schema/context"
  216.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  217.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  218.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  219. </beans>this.name = name;
  220. <?xml version="1.0" encoding="UTF-8"?>
  221. <beans xmlns="http://www.springframework.org/schema/beans"
  222.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  223.        xmlns:context="http://www.springframework.org/schema/context"
  224.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  225.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  226.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  227. </beans>}
  228. }
复制代码
设置相关的:spring.xml 的设置信息的内容,这里我们用的是注解时开发,必要加上一个组件扫描
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4.        xmlns:context="http://www.springframework.org/schema/context"
  5.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  6.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  7.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  8. </beans>
复制代码
单位测试:(一样寻常寻常的单位测试)如下:


上述:方式,代码重复率高,复用性较差。
Spring提供的方便主要是这几个注解:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring.xml")留意该:spring.xml 文件要一定要在类路径下才行
在单位测试类上使用这两个注解之后,在单位测试类中的属性上可以使用 @Autowired。比较方便。
  1. @RunWith(SpringJUnit4ClassRunner.class)
  2. @ContextConfiguration("classpath:spring.xml") // 注意该:spring.xml 文件要一定要在类路径下才行
复制代码
优化如下:


使用@Resource 必要导入相关的 jar 包,如下:
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4.        xmlns:context="http://www.springframework.org/schema/context"
  5.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  6.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  7.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  8. </beans><?xml version="1.0" encoding="UTF-8"?>
  9. <beans xmlns="http://www.springframework.org/schema/beans"
  10.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  11.        xmlns:context="http://www.springframework.org/schema/context"
  12.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  13.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  14.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  15. </beans><?xml version="1.0" encoding="UTF-8"?>
  16. <beans xmlns="http://www.springframework.org/schema/beans"
  17.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  18.        xmlns:context="http://www.springframework.org/schema/context"
  19.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  20.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  21.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  22. </beans><?xml version="1.0" encoding="UTF-8"?>
  23. <beans xmlns="http://www.springframework.org/schema/beans"
  24.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  25.        xmlns:context="http://www.springframework.org/schema/context"
  26.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  27.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  28.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  29. </beans><?xml version="1.0" encoding="UTF-8"?>
  30. <beans xmlns="http://www.springframework.org/schema/beans"
  31.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  32.        xmlns:context="http://www.springframework.org/schema/context"
  33.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  34.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  35.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  36. </beans>jakarta.annotation<?xml version="1.0" encoding="UTF-8"?>
  37. <beans xmlns="http://www.springframework.org/schema/beans"
  38.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  39.        xmlns:context="http://www.springframework.org/schema/context"
  40.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  41.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  42.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  43. </beans><?xml version="1.0" encoding="UTF-8"?>
  44. <beans xmlns="http://www.springframework.org/schema/beans"
  45.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  46.        xmlns:context="http://www.springframework.org/schema/context"
  47.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  48.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  49.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  50. </beans><?xml version="1.0" encoding="UTF-8"?>
  51. <beans xmlns="http://www.springframework.org/schema/beans"
  52.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  53.        xmlns:context="http://www.springframework.org/schema/context"
  54.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  55.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  56.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  57. </beans>jakarta.annotation-api<?xml version="1.0" encoding="UTF-8"?>
  58. <beans xmlns="http://www.springframework.org/schema/beans"
  59.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  60.        xmlns:context="http://www.springframework.org/schema/context"
  61.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  62.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  63.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  64. </beans><?xml version="1.0" encoding="UTF-8"?>
  65. <beans xmlns="http://www.springframework.org/schema/beans"
  66.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  67.        xmlns:context="http://www.springframework.org/schema/context"
  68.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  69.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  70.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  71. </beans><?xml version="1.0" encoding="UTF-8"?>
  72. <beans xmlns="http://www.springframework.org/schema/beans"
  73.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  74.        xmlns:context="http://www.springframework.org/schema/context"
  75.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  76.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  77.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  78. </beans>2.1.1<?xml version="1.0" encoding="UTF-8"?>
  79. <beans xmlns="http://www.springframework.org/schema/beans"
  80.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  81.        xmlns:context="http://www.springframework.org/schema/context"
  82.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  83.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  84.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  85. </beans><?xml version="1.0" encoding="UTF-8"?>
  86. <beans xmlns="http://www.springframework.org/schema/beans"
  87.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  88.        xmlns:context="http://www.springframework.org/schema/context"
  89.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  90.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  91.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  92. </beans>
复制代码

同时留意:该Juit4的@ Test 的注解是在:org.junit.Test; 包下的

  1. package com.rainbowsea.spring6.test;import com.rainbowsea.spring6.bean.User;import jakarta.annotation.Resource;import org.junit.Test;import org.junit.runner.RunWith;import org.springframework.test.context.ContextConfiguration;import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;@RunWith(SpringJUnit4ClassRunner.class)@ContextConfiguration("classpath:spring.xml")public class SpringJunit4Test2 {<?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4.        xmlns:context="http://www.springframework.org/schema/context"
  5.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  6.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  7.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  8. </beans>@Resource(name = "user")<?xml version="1.0" encoding="UTF-8"?>
  9. <beans xmlns="http://www.springframework.org/schema/beans"
  10.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  11.        xmlns:context="http://www.springframework.org/schema/context"
  12.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  13.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  14.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  15. </beans>private User user;<?xml version="1.0" encoding="UTF-8"?>
  16. <beans xmlns="http://www.springframework.org/schema/beans"
  17.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  18.        xmlns:context="http://www.springframework.org/schema/context"
  19.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  20.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  21.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  22. </beans>@Test<?xml version="1.0" encoding="UTF-8"?>
  23. <beans xmlns="http://www.springframework.org/schema/beans"
  24.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  25.        xmlns:context="http://www.springframework.org/schema/context"
  26.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  27.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  28.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  29. </beans>public void testUser() {<?xml version="1.0" encoding="UTF-8"?>
  30. <beans xmlns="http://www.springframework.org/schema/beans"
  31.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  32.        xmlns:context="http://www.springframework.org/schema/context"
  33.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  34.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  35.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  36. </beans><?xml version="1.0" encoding="UTF-8"?>
  37. <beans xmlns="http://www.springframework.org/schema/beans"
  38.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  39.        xmlns:context="http://www.springframework.org/schema/context"
  40.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  41.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  42.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  43. </beans>System.out.println(user.getName());<?xml version="1.0" encoding="UTF-8"?>
  44. <beans xmlns="http://www.springframework.org/schema/beans"
  45.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  46.        xmlns:context="http://www.springframework.org/schema/context"
  47.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  48.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  49.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  50. </beans>}<?xml version="1.0" encoding="UTF-8"?>
  51. <beans xmlns="http://www.springframework.org/schema/beans"
  52.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  53.        xmlns:context="http://www.springframework.org/schema/context"
  54.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  55.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  56.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  57. </beans>@Test<?xml version="1.0" encoding="UTF-8"?>
  58. <beans xmlns="http://www.springframework.org/schema/beans"
  59.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  60.        xmlns:context="http://www.springframework.org/schema/context"
  61.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  62.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  63.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  64. </beans>public void testUser2() {<?xml version="1.0" encoding="UTF-8"?>
  65. <beans xmlns="http://www.springframework.org/schema/beans"
  66.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  67.        xmlns:context="http://www.springframework.org/schema/context"
  68.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  69.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  70.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  71. </beans><?xml version="1.0" encoding="UTF-8"?>
  72. <beans xmlns="http://www.springframework.org/schema/beans"
  73.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  74.        xmlns:context="http://www.springframework.org/schema/context"
  75.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  76.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  77.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  78. </beans>System.out.println(user.getName());<?xml version="1.0" encoding="UTF-8"?>
  79. <beans xmlns="http://www.springframework.org/schema/beans"
  80.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  81.        xmlns:context="http://www.springframework.org/schema/context"
  82.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  83.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  84.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  85. </beans>}<?xml version="1.0" encoding="UTF-8"?>
  86. <beans xmlns="http://www.springframework.org/schema/beans"
  87.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  88.        xmlns:context="http://www.springframework.org/schema/context"
  89.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  90.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  91.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  92. </beans>@Test<?xml version="1.0" encoding="UTF-8"?>
  93. <beans xmlns="http://www.springframework.org/schema/beans"
  94.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  95.        xmlns:context="http://www.springframework.org/schema/context"
  96.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  97.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  98.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  99. </beans>public void testUser3() {<?xml version="1.0" encoding="UTF-8"?>
  100. <beans xmlns="http://www.springframework.org/schema/beans"
  101.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  102.        xmlns:context="http://www.springframework.org/schema/context"
  103.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  104.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  105.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  106. </beans><?xml version="1.0" encoding="UTF-8"?>
  107. <beans xmlns="http://www.springframework.org/schema/beans"
  108.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  109.        xmlns:context="http://www.springframework.org/schema/context"
  110.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  111.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  112.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  113. </beans>System.out.println(user.getName());<?xml version="1.0" encoding="UTF-8"?>
  114. <beans xmlns="http://www.springframework.org/schema/beans"
  115.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  116.        xmlns:context="http://www.springframework.org/schema/context"
  117.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  118.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  119.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  120. </beans>}}
复制代码
3. Spring对Junit5的支持

引入JUnit5的依赖,Spring对JUnit支持的依赖还是:spring-test,同时换成,junit5 ,还是在 pom.xml 文件当值设置相关依赖的 jar 如下:
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4.        xmlns:context="http://www.springframework.org/schema/context"
  5.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  6.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  7.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  8. </beans><?xml version="1.0" encoding="UTF-8"?>
  9. <beans xmlns="http://www.springframework.org/schema/beans"
  10.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  11.        xmlns:context="http://www.springframework.org/schema/context"
  12.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  13.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  14.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  15. </beans><?xml version="1.0" encoding="UTF-8"?>
  16. <beans xmlns="http://www.springframework.org/schema/beans"
  17.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  18.        xmlns:context="http://www.springframework.org/schema/context"
  19.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  20.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  21.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  22. </beans><?xml version="1.0" encoding="UTF-8"?>
  23. <beans xmlns="http://www.springframework.org/schema/beans"
  24.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  25.        xmlns:context="http://www.springframework.org/schema/context"
  26.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  27.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  28.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  29. </beans><?xml version="1.0" encoding="UTF-8"?>
  30. <beans xmlns="http://www.springframework.org/schema/beans"
  31.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  32.        xmlns:context="http://www.springframework.org/schema/context"
  33.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  34.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  35.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  36. </beans> org.junit.jupiter<?xml version="1.0" encoding="UTF-8"?>
  37. <beans xmlns="http://www.springframework.org/schema/beans"
  38.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  39.        xmlns:context="http://www.springframework.org/schema/context"
  40.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  41.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  42.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  43. </beans><?xml version="1.0" encoding="UTF-8"?>
  44. <beans xmlns="http://www.springframework.org/schema/beans"
  45.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  46.        xmlns:context="http://www.springframework.org/schema/context"
  47.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  48.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  49.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  50. </beans><?xml version="1.0" encoding="UTF-8"?>
  51. <beans xmlns="http://www.springframework.org/schema/beans"
  52.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  53.        xmlns:context="http://www.springframework.org/schema/context"
  54.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  55.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  56.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  57. </beans>junit-jupiter<?xml version="1.0" encoding="UTF-8"?>
  58. <beans xmlns="http://www.springframework.org/schema/beans"
  59.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  60.        xmlns:context="http://www.springframework.org/schema/context"
  61.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  62.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  63.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  64. </beans><?xml version="1.0" encoding="UTF-8"?>
  65. <beans xmlns="http://www.springframework.org/schema/beans"
  66.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  67.        xmlns:context="http://www.springframework.org/schema/context"
  68.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  69.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  70.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  71. </beans><?xml version="1.0" encoding="UTF-8"?>
  72. <beans xmlns="http://www.springframework.org/schema/beans"
  73.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  74.        xmlns:context="http://www.springframework.org/schema/context"
  75.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  76.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  77.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  78. </beans>5.9.0<?xml version="1.0" encoding="UTF-8"?>
  79. <beans xmlns="http://www.springframework.org/schema/beans"
  80.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  81.        xmlns:context="http://www.springframework.org/schema/context"
  82.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  83.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  84.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  85. </beans><?xml version="1.0" encoding="UTF-8"?>
  86. <beans xmlns="http://www.springframework.org/schema/beans"
  87.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  88.        xmlns:context="http://www.springframework.org/schema/context"
  89.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  90.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  91.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  92. </beans><?xml version="1.0" encoding="UTF-8"?>
  93. <beans xmlns="http://www.springframework.org/schema/beans"
  94.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  95.        xmlns:context="http://www.springframework.org/schema/context"
  96.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  97.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  98.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  99. </beans>test<?xml version="1.0" encoding="UTF-8"?>
  100. <beans xmlns="http://www.springframework.org/schema/beans"
  101.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  102.        xmlns:context="http://www.springframework.org/schema/context"
  103.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  104.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  105.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  106. </beans><?xml version="1.0" encoding="UTF-8"?>
  107. <beans xmlns="http://www.springframework.org/schema/beans"
  108.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  109.        xmlns:context="http://www.springframework.org/schema/context"
  110.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  111.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  112.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  113. </beans>
复制代码
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4.        xmlns:context="http://www.springframework.org/schema/context"
  5.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  6.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  7.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  8. </beans>4.0.0<?xml version="1.0" encoding="UTF-8"?>
  9. <beans xmlns="http://www.springframework.org/schema/beans"
  10.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  11.        xmlns:context="http://www.springframework.org/schema/context"
  12.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  13.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  14.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  15. </beans>com.rainbowsea<?xml version="1.0" encoding="UTF-8"?>
  16. <beans xmlns="http://www.springframework.org/schema/beans"
  17.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  18.        xmlns:context="http://www.springframework.org/schema/context"
  19.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  20.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  21.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  22. </beans>spring6-015-junit<?xml version="1.0" encoding="UTF-8"?>
  23. <beans xmlns="http://www.springframework.org/schema/beans"
  24.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  25.        xmlns:context="http://www.springframework.org/schema/context"
  26.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  27.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  28.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  29. </beans>1.0-SNAPSHOT<?xml version="1.0" encoding="UTF-8"?>
  30. <beans xmlns="http://www.springframework.org/schema/beans"
  31.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  32.        xmlns:context="http://www.springframework.org/schema/context"
  33.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  34.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  35.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  36. </beans>jar<?xml version="1.0" encoding="UTF-8"?>
  37. <beans xmlns="http://www.springframework.org/schema/beans"
  38.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  39.        xmlns:context="http://www.springframework.org/schema/context"
  40.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  41.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  42.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  43. </beans><?xml version="1.0" encoding="UTF-8"?>
  44. <beans xmlns="http://www.springframework.org/schema/beans"
  45.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  46.        xmlns:context="http://www.springframework.org/schema/context"
  47.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  48.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  49.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  50. </beans><?xml version="1.0" encoding="UTF-8"?>
  51. <beans xmlns="http://www.springframework.org/schema/beans"
  52.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  53.        xmlns:context="http://www.springframework.org/schema/context"
  54.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  55.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  56.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  57. </beans>17<?xml version="1.0" encoding="UTF-8"?>
  58. <beans xmlns="http://www.springframework.org/schema/beans"
  59.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  60.        xmlns:context="http://www.springframework.org/schema/context"
  61.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  62.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  63.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  64. </beans><?xml version="1.0" encoding="UTF-8"?>
  65. <beans xmlns="http://www.springframework.org/schema/beans"
  66.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  67.        xmlns:context="http://www.springframework.org/schema/context"
  68.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  69.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  70.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  71. </beans>17<?xml version="1.0" encoding="UTF-8"?>
  72. <beans xmlns="http://www.springframework.org/schema/beans"
  73.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  74.        xmlns:context="http://www.springframework.org/schema/context"
  75.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  76.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  77.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  78. </beans><?xml version="1.0" encoding="UTF-8"?>
  79. <beans xmlns="http://www.springframework.org/schema/beans"
  80.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  81.        xmlns:context="http://www.springframework.org/schema/context"
  82.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  83.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  84.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  85. </beans><?xml version="1.0" encoding="UTF-8"?>
  86. <beans xmlns="http://www.springframework.org/schema/beans"
  87.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  88.        xmlns:context="http://www.springframework.org/schema/context"
  89.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  90.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  91.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  92. </beans><?xml version="1.0" encoding="UTF-8"?>
  93. <beans xmlns="http://www.springframework.org/schema/beans"
  94.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  95.        xmlns:context="http://www.springframework.org/schema/context"
  96.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  97.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  98.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  99. </beans><?xml version="1.0" encoding="UTF-8"?>
  100. <beans xmlns="http://www.springframework.org/schema/beans"
  101.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  102.        xmlns:context="http://www.springframework.org/schema/context"
  103.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  104.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  105.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  106. </beans><?xml version="1.0" encoding="UTF-8"?>
  107. <beans xmlns="http://www.springframework.org/schema/beans"
  108.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  109.        xmlns:context="http://www.springframework.org/schema/context"
  110.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  111.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  112.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  113. </beans><?xml version="1.0" encoding="UTF-8"?>
  114. <beans xmlns="http://www.springframework.org/schema/beans"
  115.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  116.        xmlns:context="http://www.springframework.org/schema/context"
  117.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  118.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  119.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  120. </beans><?xml version="1.0" encoding="UTF-8"?>
  121. <beans xmlns="http://www.springframework.org/schema/beans"
  122.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  123.        xmlns:context="http://www.springframework.org/schema/context"
  124.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  125.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  126.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  127. </beans><?xml version="1.0" encoding="UTF-8"?>
  128. <beans xmlns="http://www.springframework.org/schema/beans"
  129.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  130.        xmlns:context="http://www.springframework.org/schema/context"
  131.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  132.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  133.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  134. </beans><?xml version="1.0" encoding="UTF-8"?>
  135. <beans xmlns="http://www.springframework.org/schema/beans"
  136.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  137.        xmlns:context="http://www.springframework.org/schema/context"
  138.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  139.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  140.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  141. </beans>repository.spring.milestone<?xml version="1.0" encoding="UTF-8"?>
  142. <beans xmlns="http://www.springframework.org/schema/beans"
  143.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  144.        xmlns:context="http://www.springframework.org/schema/context"
  145.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  146.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  147.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  148. </beans><?xml version="1.0" encoding="UTF-8"?>
  149. <beans xmlns="http://www.springframework.org/schema/beans"
  150.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  151.        xmlns:context="http://www.springframework.org/schema/context"
  152.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  153.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  154.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  155. </beans><?xml version="1.0" encoding="UTF-8"?>
  156. <beans xmlns="http://www.springframework.org/schema/beans"
  157.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  158.        xmlns:context="http://www.springframework.org/schema/context"
  159.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  160.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  161.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  162. </beans>Spring Milestone Repository<?xml version="1.0" encoding="UTF-8"?>
  163. <beans xmlns="http://www.springframework.org/schema/beans"
  164.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  165.        xmlns:context="http://www.springframework.org/schema/context"
  166.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  167.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  168.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  169. </beans><?xml version="1.0" encoding="UTF-8"?>
  170. <beans xmlns="http://www.springframework.org/schema/beans"
  171.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  172.        xmlns:context="http://www.springframework.org/schema/context"
  173.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  174.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  175.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  176. </beans><?xml version="1.0" encoding="UTF-8"?>
  177. <beans xmlns="http://www.springframework.org/schema/beans"
  178.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  179.        xmlns:context="http://www.springframework.org/schema/context"
  180.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  181.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  182.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  183. </beans>https://repo.spring.io/milestone<?xml version="1.0" encoding="UTF-8"?>
  184. <beans xmlns="http://www.springframework.org/schema/beans"
  185.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  186.        xmlns:context="http://www.springframework.org/schema/context"
  187.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  188.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  189.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  190. </beans><?xml version="1.0" encoding="UTF-8"?>
  191. <beans xmlns="http://www.springframework.org/schema/beans"
  192.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  193.        xmlns:context="http://www.springframework.org/schema/context"
  194.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  195.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  196.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  197. </beans><?xml version="1.0" encoding="UTF-8"?>
  198. <beans xmlns="http://www.springframework.org/schema/beans"
  199.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  200.        xmlns:context="http://www.springframework.org/schema/context"
  201.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  202.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  203.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  204. </beans><?xml version="1.0" encoding="UTF-8"?>
  205. <beans xmlns="http://www.springframework.org/schema/beans"
  206.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  207.        xmlns:context="http://www.springframework.org/schema/context"
  208.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  209.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  210.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  211. </beans><?xml version="1.0" encoding="UTF-8"?>
  212. <beans xmlns="http://www.springframework.org/schema/beans"
  213.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  214.        xmlns:context="http://www.springframework.org/schema/context"
  215.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  216.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  217.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  218. </beans><?xml version="1.0" encoding="UTF-8"?>
  219. <beans xmlns="http://www.springframework.org/schema/beans"
  220.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  221.        xmlns:context="http://www.springframework.org/schema/context"
  222.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  223.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  224.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  225. </beans><?xml version="1.0" encoding="UTF-8"?>
  226. <beans xmlns="http://www.springframework.org/schema/beans"
  227.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  228.        xmlns:context="http://www.springframework.org/schema/context"
  229.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  230.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  231.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  232. </beans><?xml version="1.0" encoding="UTF-8"?>
  233. <beans xmlns="http://www.springframework.org/schema/beans"
  234.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  235.        xmlns:context="http://www.springframework.org/schema/context"
  236.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  237.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  238.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  239. </beans><?xml version="1.0" encoding="UTF-8"?>
  240. <beans xmlns="http://www.springframework.org/schema/beans"
  241.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  242.        xmlns:context="http://www.springframework.org/schema/context"
  243.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  244.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  245.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  246. </beans><?xml version="1.0" encoding="UTF-8"?>
  247. <beans xmlns="http://www.springframework.org/schema/beans"
  248.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  249.        xmlns:context="http://www.springframework.org/schema/context"
  250.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  251.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  252.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  253. </beans><?xml version="1.0" encoding="UTF-8"?>
  254. <beans xmlns="http://www.springframework.org/schema/beans"
  255.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  256.        xmlns:context="http://www.springframework.org/schema/context"
  257.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  258.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  259.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  260. </beans>org.springframework<?xml version="1.0" encoding="UTF-8"?>
  261. <beans xmlns="http://www.springframework.org/schema/beans"
  262.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  263.        xmlns:context="http://www.springframework.org/schema/context"
  264.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  265.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  266.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  267. </beans><?xml version="1.0" encoding="UTF-8"?>
  268. <beans xmlns="http://www.springframework.org/schema/beans"
  269.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  270.        xmlns:context="http://www.springframework.org/schema/context"
  271.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  272.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  273.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  274. </beans><?xml version="1.0" encoding="UTF-8"?>
  275. <beans xmlns="http://www.springframework.org/schema/beans"
  276.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  277.        xmlns:context="http://www.springframework.org/schema/context"
  278.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  279.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  280.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  281. </beans>spring-context<?xml version="1.0" encoding="UTF-8"?>
  282. <beans xmlns="http://www.springframework.org/schema/beans"
  283.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  284.        xmlns:context="http://www.springframework.org/schema/context"
  285.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  286.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  287.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  288. </beans><?xml version="1.0" encoding="UTF-8"?>
  289. <beans xmlns="http://www.springframework.org/schema/beans"
  290.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  291.        xmlns:context="http://www.springframework.org/schema/context"
  292.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  293.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  294.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  295. </beans><?xml version="1.0" encoding="UTF-8"?>
  296. <beans xmlns="http://www.springframework.org/schema/beans"
  297.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  298.        xmlns:context="http://www.springframework.org/schema/context"
  299.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  300.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  301.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  302. </beans>6.0.11<?xml version="1.0" encoding="UTF-8"?>
  303. <beans xmlns="http://www.springframework.org/schema/beans"
  304.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  305.        xmlns:context="http://www.springframework.org/schema/context"
  306.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  307.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  308.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  309. </beans><?xml version="1.0" encoding="UTF-8"?>
  310. <beans xmlns="http://www.springframework.org/schema/beans"
  311.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  312.        xmlns:context="http://www.springframework.org/schema/context"
  313.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  314.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  315.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  316. </beans><?xml version="1.0" encoding="UTF-8"?>
  317. <beans xmlns="http://www.springframework.org/schema/beans"
  318.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  319.        xmlns:context="http://www.springframework.org/schema/context"
  320.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  321.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  322.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  323. </beans><?xml version="1.0" encoding="UTF-8"?>
  324. <beans xmlns="http://www.springframework.org/schema/beans"
  325.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  326.        xmlns:context="http://www.springframework.org/schema/context"
  327.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  328.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  329.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  330. </beans><?xml version="1.0" encoding="UTF-8"?>
  331. <beans xmlns="http://www.springframework.org/schema/beans"
  332.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  333.        xmlns:context="http://www.springframework.org/schema/context"
  334.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  335.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  336.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  337. </beans><?xml version="1.0" encoding="UTF-8"?>
  338. <beans xmlns="http://www.springframework.org/schema/beans"
  339.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  340.        xmlns:context="http://www.springframework.org/schema/context"
  341.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  342.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  343.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  344. </beans><?xml version="1.0" encoding="UTF-8"?>
  345. <beans xmlns="http://www.springframework.org/schema/beans"
  346.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  347.        xmlns:context="http://www.springframework.org/schema/context"
  348.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  349.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  350.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  351. </beans><?xml version="1.0" encoding="UTF-8"?>
  352. <beans xmlns="http://www.springframework.org/schema/beans"
  353.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  354.        xmlns:context="http://www.springframework.org/schema/context"
  355.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  356.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  357.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  358. </beans><?xml version="1.0" encoding="UTF-8"?>
  359. <beans xmlns="http://www.springframework.org/schema/beans"
  360.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  361.        xmlns:context="http://www.springframework.org/schema/context"
  362.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  363.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  364.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  365. </beans><?xml version="1.0" encoding="UTF-8"?>
  366. <beans xmlns="http://www.springframework.org/schema/beans"
  367.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  368.        xmlns:context="http://www.springframework.org/schema/context"
  369.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  370.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  371.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  372. </beans><?xml version="1.0" encoding="UTF-8"?>
  373. <beans xmlns="http://www.springframework.org/schema/beans"
  374.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  375.        xmlns:context="http://www.springframework.org/schema/context"
  376.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  377.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  378.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  379. </beans>org.springframework<?xml version="1.0" encoding="UTF-8"?>
  380. <beans xmlns="http://www.springframework.org/schema/beans"
  381.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  382.        xmlns:context="http://www.springframework.org/schema/context"
  383.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  384.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  385.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  386. </beans><?xml version="1.0" encoding="UTF-8"?>
  387. <beans xmlns="http://www.springframework.org/schema/beans"
  388.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  389.        xmlns:context="http://www.springframework.org/schema/context"
  390.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  391.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  392.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  393. </beans><?xml version="1.0" encoding="UTF-8"?>
  394. <beans xmlns="http://www.springframework.org/schema/beans"
  395.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  396.        xmlns:context="http://www.springframework.org/schema/context"
  397.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  398.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  399.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  400. </beans>spring-test<?xml version="1.0" encoding="UTF-8"?>
  401. <beans xmlns="http://www.springframework.org/schema/beans"
  402.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  403.        xmlns:context="http://www.springframework.org/schema/context"
  404.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  405.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  406.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  407. </beans><?xml version="1.0" encoding="UTF-8"?>
  408. <beans xmlns="http://www.springframework.org/schema/beans"
  409.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  410.        xmlns:context="http://www.springframework.org/schema/context"
  411.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  412.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  413.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  414. </beans><?xml version="1.0" encoding="UTF-8"?>
  415. <beans xmlns="http://www.springframework.org/schema/beans"
  416.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  417.        xmlns:context="http://www.springframework.org/schema/context"
  418.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  419.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  420.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  421. </beans><?xml version="1.0" encoding="UTF-8"?>
  422. <beans xmlns="http://www.springframework.org/schema/beans"
  423.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  424.        xmlns:context="http://www.springframework.org/schema/context"
  425.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  426.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  427.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  428. </beans><?xml version="1.0" encoding="UTF-8"?>
  429. <beans xmlns="http://www.springframework.org/schema/beans"
  430.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  431.        xmlns:context="http://www.springframework.org/schema/context"
  432.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  433.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  434.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  435. </beans><?xml version="1.0" encoding="UTF-8"?>
  436. <beans xmlns="http://www.springframework.org/schema/beans"
  437.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  438.        xmlns:context="http://www.springframework.org/schema/context"
  439.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  440.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  441.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  442. </beans>6.0.11<?xml version="1.0" encoding="UTF-8"?>
  443. <beans xmlns="http://www.springframework.org/schema/beans"
  444.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  445.        xmlns:context="http://www.springframework.org/schema/context"
  446.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  447.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  448.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  449. </beans><?xml version="1.0" encoding="UTF-8"?>
  450. <beans xmlns="http://www.springframework.org/schema/beans"
  451.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  452.        xmlns:context="http://www.springframework.org/schema/context"
  453.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  454.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  455.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  456. </beans><?xml version="1.0" encoding="UTF-8"?>
  457. <beans xmlns="http://www.springframework.org/schema/beans"
  458.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  459.        xmlns:context="http://www.springframework.org/schema/context"
  460.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  461.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  462.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  463. </beans><?xml version="1.0" encoding="UTF-8"?>
  464. <beans xmlns="http://www.springframework.org/schema/beans"
  465.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  466.        xmlns:context="http://www.springframework.org/schema/context"
  467.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  468.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  469.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  470. </beans><?xml version="1.0" encoding="UTF-8"?>
  471. <beans xmlns="http://www.springframework.org/schema/beans"
  472.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  473.        xmlns:context="http://www.springframework.org/schema/context"
  474.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  475.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  476.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  477. </beans><?xml version="1.0" encoding="UTF-8"?>
  478. <beans xmlns="http://www.springframework.org/schema/beans"
  479.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  480.        xmlns:context="http://www.springframework.org/schema/context"
  481.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  482.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  483.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  484. </beans><?xml version="1.0" encoding="UTF-8"?>
  485. <beans xmlns="http://www.springframework.org/schema/beans"
  486.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  487.        xmlns:context="http://www.springframework.org/schema/context"
  488.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  489.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  490.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  491. </beans><?xml version="1.0" encoding="UTF-8"?>
  492. <beans xmlns="http://www.springframework.org/schema/beans"
  493.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  494.        xmlns:context="http://www.springframework.org/schema/context"
  495.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  496.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  497.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  498. </beans><?xml version="1.0" encoding="UTF-8"?>
  499. <beans xmlns="http://www.springframework.org/schema/beans"
  500.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  501.        xmlns:context="http://www.springframework.org/schema/context"
  502.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  503.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  504.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  505. </beans>org.junit.jupiter<?xml version="1.0" encoding="UTF-8"?>
  506. <beans xmlns="http://www.springframework.org/schema/beans"
  507.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  508.        xmlns:context="http://www.springframework.org/schema/context"
  509.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  510.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  511.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  512. </beans><?xml version="1.0" encoding="UTF-8"?>
  513. <beans xmlns="http://www.springframework.org/schema/beans"
  514.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  515.        xmlns:context="http://www.springframework.org/schema/context"
  516.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  517.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  518.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  519. </beans><?xml version="1.0" encoding="UTF-8"?>
  520. <beans xmlns="http://www.springframework.org/schema/beans"
  521.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  522.        xmlns:context="http://www.springframework.org/schema/context"
  523.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  524.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  525.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  526. </beans>junit-jupiter<?xml version="1.0" encoding="UTF-8"?>
  527. <beans xmlns="http://www.springframework.org/schema/beans"
  528.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  529.        xmlns:context="http://www.springframework.org/schema/context"
  530.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  531.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  532.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  533. </beans><?xml version="1.0" encoding="UTF-8"?>
  534. <beans xmlns="http://www.springframework.org/schema/beans"
  535.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  536.        xmlns:context="http://www.springframework.org/schema/context"
  537.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  538.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  539.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  540. </beans><?xml version="1.0" encoding="UTF-8"?>
  541. <beans xmlns="http://www.springframework.org/schema/beans"
  542.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  543.        xmlns:context="http://www.springframework.org/schema/context"
  544.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  545.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  546.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  547. </beans>5.9.0<?xml version="1.0" encoding="UTF-8"?>
  548. <beans xmlns="http://www.springframework.org/schema/beans"
  549.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  550.        xmlns:context="http://www.springframework.org/schema/context"
  551.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  552.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  553.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  554. </beans><?xml version="1.0" encoding="UTF-8"?>
  555. <beans xmlns="http://www.springframework.org/schema/beans"
  556.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  557.        xmlns:context="http://www.springframework.org/schema/context"
  558.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  559.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  560.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  561. </beans><?xml version="1.0" encoding="UTF-8"?>
  562. <beans xmlns="http://www.springframework.org/schema/beans"
  563.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  564.        xmlns:context="http://www.springframework.org/schema/context"
  565.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  566.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  567.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  568. </beans>test<?xml version="1.0" encoding="UTF-8"?>
  569. <beans xmlns="http://www.springframework.org/schema/beans"
  570.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  571.        xmlns:context="http://www.springframework.org/schema/context"
  572.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  573.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  574.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  575. </beans><?xml version="1.0" encoding="UTF-8"?>
  576. <beans xmlns="http://www.springframework.org/schema/beans"
  577.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  578.        xmlns:context="http://www.springframework.org/schema/context"
  579.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  580.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  581.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  582. </beans><?xml version="1.0" encoding="UTF-8"?>
  583. <beans xmlns="http://www.springframework.org/schema/beans"
  584.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  585.        xmlns:context="http://www.springframework.org/schema/context"
  586.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  587.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  588.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  589. </beans><?xml version="1.0" encoding="UTF-8"?>
  590. <beans xmlns="http://www.springframework.org/schema/beans"
  591.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  592.        xmlns:context="http://www.springframework.org/schema/context"
  593.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  594.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  595.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  596. </beans><?xml version="1.0" encoding="UTF-8"?>
  597. <beans xmlns="http://www.springframework.org/schema/beans"
  598.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  599.        xmlns:context="http://www.springframework.org/schema/context"
  600.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  601.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  602.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  603. </beans><?xml version="1.0" encoding="UTF-8"?>
  604. <beans xmlns="http://www.springframework.org/schema/beans"
  605.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  606.        xmlns:context="http://www.springframework.org/schema/context"
  607.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  608.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  609.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  610. </beans><?xml version="1.0" encoding="UTF-8"?>
  611. <beans xmlns="http://www.springframework.org/schema/beans"
  612.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  613.        xmlns:context="http://www.springframework.org/schema/context"
  614.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  615.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  616.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  617. </beans><?xml version="1.0" encoding="UTF-8"?>
  618. <beans xmlns="http://www.springframework.org/schema/beans"
  619.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  620.        xmlns:context="http://www.springframework.org/schema/context"
  621.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  622.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  623.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  624. </beans><?xml version="1.0" encoding="UTF-8"?>
  625. <beans xmlns="http://www.springframework.org/schema/beans"
  626.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  627.        xmlns:context="http://www.springframework.org/schema/context"
  628.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  629.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  630.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  631. </beans>jakarta.annotation<?xml version="1.0" encoding="UTF-8"?>
  632. <beans xmlns="http://www.springframework.org/schema/beans"
  633.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  634.        xmlns:context="http://www.springframework.org/schema/context"
  635.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  636.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  637.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  638. </beans><?xml version="1.0" encoding="UTF-8"?>
  639. <beans xmlns="http://www.springframework.org/schema/beans"
  640.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  641.        xmlns:context="http://www.springframework.org/schema/context"
  642.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  643.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  644.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  645. </beans><?xml version="1.0" encoding="UTF-8"?>
  646. <beans xmlns="http://www.springframework.org/schema/beans"
  647.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  648.        xmlns:context="http://www.springframework.org/schema/context"
  649.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  650.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  651.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  652. </beans>jakarta.annotation-api<?xml version="1.0" encoding="UTF-8"?>
  653. <beans xmlns="http://www.springframework.org/schema/beans"
  654.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  655.        xmlns:context="http://www.springframework.org/schema/context"
  656.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  657.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  658.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  659. </beans><?xml version="1.0" encoding="UTF-8"?>
  660. <beans xmlns="http://www.springframework.org/schema/beans"
  661.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  662.        xmlns:context="http://www.springframework.org/schema/context"
  663.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  664.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  665.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  666. </beans><?xml version="1.0" encoding="UTF-8"?>
  667. <beans xmlns="http://www.springframework.org/schema/beans"
  668.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  669.        xmlns:context="http://www.springframework.org/schema/context"
  670.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  671.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  672.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  673. </beans>2.1.1<?xml version="1.0" encoding="UTF-8"?>
  674. <beans xmlns="http://www.springframework.org/schema/beans"
  675.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  676.        xmlns:context="http://www.springframework.org/schema/context"
  677.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  678.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  679.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  680. </beans><?xml version="1.0" encoding="UTF-8"?>
  681. <beans xmlns="http://www.springframework.org/schema/beans"
  682.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  683.        xmlns:context="http://www.springframework.org/schema/context"
  684.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  685.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  686.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  687. </beans><?xml version="1.0" encoding="UTF-8"?>
  688. <beans xmlns="http://www.springframework.org/schema/beans"
  689.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  690.        xmlns:context="http://www.springframework.org/schema/context"
  691.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  692.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  693.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  694. </beans>
复制代码
还是使用上面的 User 的 bean 对象进行测试:

在JUnit5当中,可以使用Spring提供的以下两个注解,标注到单位测试类上,这样在类当中就可以使用@Autowired注解了。
  1. @ExtendWith(SpringExtension.class)
  2. @ContextConfiguration("classpath:spring.xml")  // 同样一定要是在类路径下
复制代码
@ContextConfiguration("classpath:spring.xml")  // 同样一定要是在类路径下

同时留意:该Juit5 的@ Test 的注解是在:org.junit.jupiter.api.Test 包下的 ,选择的时候不要,弄错了。

单位测试:
  1. package com.rainbowsea.spring6.test;import com.rainbowsea.spring6.bean.User;import jakarta.annotation.Resource;import org.junit.jupiter.api.Test;import org.junit.jupiter.api.extension.ExtendWith;import org.springframework.test.context.ContextConfiguration;import org.springframework.test.context.junit.jupiter.SpringExtension;@ExtendWith(SpringExtension.class)@ContextConfiguration("classpath:spring.xml")public class SpringJunit5Test {<?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4.        xmlns:context="http://www.springframework.org/schema/context"
  5.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  6.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  7.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  8. </beans>@Resource(name = "user")  // 非简朴类型的注入,赋值,交给Spring管理<?xml version="1.0" encoding="UTF-8"?>
  9. <beans xmlns="http://www.springframework.org/schema/beans"
  10.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  11.        xmlns:context="http://www.springframework.org/schema/context"
  12.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  13.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  14.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  15. </beans>private User user;<?xml version="1.0" encoding="UTF-8"?>
  16. <beans xmlns="http://www.springframework.org/schema/beans"
  17.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  18.        xmlns:context="http://www.springframework.org/schema/context"
  19.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  20.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  21.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  22. </beans>@Test  // import org.junit.jupiter.api.Test;<?xml version="1.0" encoding="UTF-8"?>
  23. <beans xmlns="http://www.springframework.org/schema/beans"
  24.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  25.        xmlns:context="http://www.springframework.org/schema/context"
  26.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  27.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  28.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  29. </beans>public void testUser() {<?xml version="1.0" encoding="UTF-8"?>
  30. <beans xmlns="http://www.springframework.org/schema/beans"
  31.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  32.        xmlns:context="http://www.springframework.org/schema/context"
  33.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  34.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  35.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  36. </beans><?xml version="1.0" encoding="UTF-8"?>
  37. <beans xmlns="http://www.springframework.org/schema/beans"
  38.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  39.        xmlns:context="http://www.springframework.org/schema/context"
  40.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  41.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  42.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  43. </beans>System.out.println(user.getName());<?xml version="1.0" encoding="UTF-8"?>
  44. <beans xmlns="http://www.springframework.org/schema/beans"
  45.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  46.        xmlns:context="http://www.springframework.org/schema/context"
  47.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  48.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  49.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  50. </beans>}<?xml version="1.0" encoding="UTF-8"?>
  51. <beans xmlns="http://www.springframework.org/schema/beans"
  52.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  53.        xmlns:context="http://www.springframework.org/schema/context"
  54.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  55.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  56.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  57. </beans>@Test  // import org.junit.jupiter.api.Test;<?xml version="1.0" encoding="UTF-8"?>
  58. <beans xmlns="http://www.springframework.org/schema/beans"
  59.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  60.        xmlns:context="http://www.springframework.org/schema/context"
  61.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  62.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  63.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  64. </beans>public void testUser2() {<?xml version="1.0" encoding="UTF-8"?>
  65. <beans xmlns="http://www.springframework.org/schema/beans"
  66.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  67.        xmlns:context="http://www.springframework.org/schema/context"
  68.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  69.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  70.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  71. </beans><?xml version="1.0" encoding="UTF-8"?>
  72. <beans xmlns="http://www.springframework.org/schema/beans"
  73.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  74.        xmlns:context="http://www.springframework.org/schema/context"
  75.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  76.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  77.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  78. </beans>System.out.println(user.getName());<?xml version="1.0" encoding="UTF-8"?>
  79. <beans xmlns="http://www.springframework.org/schema/beans"
  80.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  81.        xmlns:context="http://www.springframework.org/schema/context"
  82.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  83.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  84.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  85. </beans>}<?xml version="1.0" encoding="UTF-8"?>
  86. <beans xmlns="http://www.springframework.org/schema/beans"
  87.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  88.        xmlns:context="http://www.springframework.org/schema/context"
  89.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  90.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  91.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  92. </beans>@Test  // import org.junit.jupiter.api.Test;<?xml version="1.0" encoding="UTF-8"?>
  93. <beans xmlns="http://www.springframework.org/schema/beans"
  94.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  95.        xmlns:context="http://www.springframework.org/schema/context"
  96.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  97.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  98.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  99. </beans>public void testUser3() {<?xml version="1.0" encoding="UTF-8"?>
  100. <beans xmlns="http://www.springframework.org/schema/beans"
  101.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  102.        xmlns:context="http://www.springframework.org/schema/context"
  103.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  104.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  105.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  106. </beans><?xml version="1.0" encoding="UTF-8"?>
  107. <beans xmlns="http://www.springframework.org/schema/beans"
  108.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  109.        xmlns:context="http://www.springframework.org/schema/context"
  110.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  111.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  112.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  113. </beans>System.out.println(user.getName());<?xml version="1.0" encoding="UTF-8"?>
  114. <beans xmlns="http://www.springframework.org/schema/beans"
  115.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  116.        xmlns:context="http://www.springframework.org/schema/context"
  117.        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  118.        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
  119.     <context:component-scan base-package="com.rainbowsea.spring6.bean"></context:component-scan>
  120. </beans>}}
复制代码
4. 总结:


  • Spring 对 Junit4 的依赖的 jar 包,同时
  1. @RunWith(SpringJUnit4ClassRunner.class)
  2. @ContextConfiguration("classpath:spring.xml") // 注意该:spring.xml 文件要一定要在类路径下才行
复制代码

  • 同时留意:该Juit4的@Test 的注解是在:org.junit.Test; 包下的
  • Spring 对 Junit5 的依赖的 jar 包,同时
  1. @ExtendWith(SpringExtension.class)
  2. @ContextConfiguration("classpath:spring.xml")  // 同样一定要是在类路径下
复制代码

  • 无论是 Junit4 还是 Junit5 当中的  @ContextConfiguration 注解当中的 @ContextConfiguration("classpath:spring.xml")  都是:一定要是在类路径下才行的。
  • 关于:Spring 对 Junit4,Junit5 的支持运用,大家灵活选择运用即可,并不是非要选择其中的哪个哪个啥的。满意业务即可。
5. 末了:

“在这个末了的篇章中,我要表达我对每一位读者的感激之情。你们的关注和回复是我创作的动力源泉,我从你们身上吸取了无尽的灵感与勇气。我会将你们的鼓励留在心底,继续在其他的领域奋斗。感谢你们,我们总会在某个时刻再次相遇。”


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

正序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

金歌

金牌会员
这个人很懒什么都没写!
快速回复 返回顶部 返回列表