{"id":360,"date":"2024-05-12T23:20:50","date_gmt":"2024-05-12T15:20:50","guid":{"rendered":"http:\/\/tck0521.ddns.net:6789\/?p=360"},"modified":"2024-05-13T08:57:15","modified_gmt":"2024-05-13T00:57:15","slug":"%e7%94%a8spring-boot%e5%bf%ab%e9%80%9f%e6%90%ad%e5%bb%ba%e4%b8%80%e4%b8%aa%e5%90%8e%e5%8f%b0%e5%ba%94%e7%94%a8","status":"publish","type":"post","link":"https:\/\/tck0521.dpdns.org\/?p=360","title":{"rendered":"\u5feb\u901f\u642d\u5efaSpring Boot\u540e\u53f0\u5e94\u7528"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Spring Boot \u662f\u4e00\u4e2a\u5f00\u6e90\u6846\u67b6\uff0c\u7528\u4e8e\u5feb\u901f\u3001\u8f7b\u677e\u5730\u521b\u5efa\u57fa\u4e8e Java \u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u5b83\u7b80\u5316\u4e86 Spring \u6846\u67b6\u7684\u914d\u7f6e\u548c\u8bbe\u7f6e\uff0c\u4f7f\u5f00\u53d1\u4eba\u5458\u80fd\u591f\u4e13\u6ce8\u4e8e\u7f16\u5199\u4e1a\u52a1\u903b\u8f91\u3002\u540c\u65f6\u5b83\u63d0\u4f9b\u4e86\u5f00\u7bb1\u5373\u7528\u7684\u529f\u80fd\uff0c\u4f8b\u5982\u81ea\u52a8\u914d\u7f6e\u3001\u5d4c\u5165\u5f0f\u670d\u52a1\u5668\u548c\u7b80\u5316\u7684\u4f9d\u8d56\u7ba1\u7406\uff0c\u4f7f\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u66f4\u52a0\u9ad8\u6548\u3002\u5b83\u8fd8\u96c6\u6210\u4e86\u5e7f\u6cdb\u7684\u7b2c\u4e09\u65b9\u5e93\u548c\u6280\u672f\uff0c\u4f7f\u5f00\u53d1\u4eba\u5458\u80fd\u591f\u8f7b\u677e\u5730\u6784\u5efa\u5065\u58ee\u4e14\u53ef\u6269\u5c55\u7684\u5e94\u7528\u7a0b\u5e8f\u3002<\/h2>\n\n\n\n<p>\u5728\u8fd9\u91cc\u6211\u4f1a\u4ecb\u7ecd\u4e00\u4e0b\u5982\u4f55\u8bbe\u7f6e\u672c\u5730\u73af\u5883\u5e76\u4e14\u7528Spring bott\u7684CLI\u548cSpring Initializr\u6765\u5feb\u901f\u521b\u5efa\u4e00\u4e2a\u540e\u53f0\u5e94\u7528\u6846\u67b6<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u672c\u5730\u73af\u5883\u8bbe\u7f6e<\/h2>\n\n\n\n<p>\u65e0\u8bba\u662fMac\u8fd8\u662fWindows, \u8981 \u8fd0\u884c\u4e00\u4e2aJava\u5e94\u7528\u90fd\u5fc5\u987b\u8981\u5148\u8bbe\u7f6e\u597d\u73af\u5883,\u90a3\u73af\u5883\u8bbe\u7f6e\u5177\u4f53\u5305\u62ec\u4ec0\u4e48\u5462? \u6211\u8fd9\u91cc\u603b\u7ed3\u5c312\u70b9: 1) \u5b89\u88c5Java\u7684SDK\u548c\u6784\u5efa\u5de5\u5177(e.g. Maven\/Gradle) 2)\u8bbe\u7f6e\u8fd0\u884c\u8fd9\u4e9b\u5e93\u548c\u5de5\u5177\u7684\u7cfb\u7edf\u53c2\u6570. \u8fd9\u6837\u4f60\u5c31\u53ef\u4ee5\u5728\u672c\u5730\u542f\u52a8JVM\u6765\u8fd0\u884c\u4f60\u7684JAVA\u7a0b\u5e8f\u4e86<\/p>\n\n\n\n<p>\u6211\u7528\u7684\u662fMac, \u672c\u6765\u60f3\u5077\u61d2\u7528homebrew\u6765\u5b89\u88c5\u4ee5\u4e0a\u7684\u5de5\u5177\u548c\u73af\u5883,\u4f46\u53d1\u73b0\u5728\u56fd\u5185\u8fd0\u884chomebrew\u6781\u5176\u4e0d\u7a33\u5b9a,\u65f6\u957f\u4f1a\u88ab\u4e2d\u65ad,\u6240\u4ee5\u6211\u6700\u540e\u4f7f\u7528\u7684\u6bd4\u8f83\u539f\u59cb\u7684\u65b9\u6cd5,\u5c31\u662f\u81ea\u884c\u53bb\u5b98\u7f51\u4e0b\u8f7d\u8fd9\u4e9b\u5de5\u5177\u7684\u5b89\u88c5\u5305,\u7136\u540e\u624b\u52a8\u8bbe\u7f6e\u4ed6\u4eec\u5728\u672c\u5730\u73af\u5883\u8fd0\u884c\u7684\u8def\u5f84\u548c\u53c2\u6570. \u8fd9\u91cc\u6211\u4ecb\u7ecd\u4e00\u4e0b\u4ee5\u4e0b\u51e0\u4e2a\u5de5\u5177\u7684\u5b89\u88c5<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><\/td><td><strong>\u5de5\u5177<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\"><\/td><td><strong>\u7248\u672c<\/strong><\/td><td><strong>\u4e0b\u8f7d\u94fe\u63a5<\/strong><\/td><\/tr><tr><td>1<\/td><td>Java SDK <\/td><td class=\"has-text-align-center\" data-align=\"center\"><img loading=\"lazy\" decoding=\"async\" width=\"128\" height=\"128\" class=\"wp-image-380\" style=\"width: 128px;\" src=\"http:\/\/tck0521.ddns.net:6789\/wp-content\/uploads\/2024\/05\/java.png\" alt=\"\"><\/td><td>21 (jdk-21_macos-aarch64_bin.dmg)<\/td><td><a href=\"https:\/\/www.oracle.com\/java\/technologies\/downloads\/#jdk21-mac\">Link<\/a><\/td><\/tr><tr><td>2<\/td><td>Maven<\/td><td class=\"has-text-align-center\" data-align=\"center\"><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"39\" class=\"wp-image-381\" style=\"width: 150px;\" src=\"http:\/\/tck0521.ddns.net:6789\/wp-content\/uploads\/2024\/05\/maven.png\" alt=\"\" srcset=\"https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/maven.png 495w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/maven-300x78.png 300w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/><\/td><td>3.9<\/td><td><a href=\"https:\/\/dlcdn.apache.org\/maven\/maven-3\/3.9.6\/binaries\/\">Link<\/a><\/td><\/tr><tr><td>3<\/td><td>Gradle \u00a0<\/td><td class=\"has-text-align-center\" data-align=\"center\"><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"110\" class=\"wp-image-382\" style=\"width: 150px;\" src=\"http:\/\/tck0521.ddns.net:6789\/wp-content\/uploads\/2024\/05\/gradle-seeklogo.com_.png\" alt=\"\"><\/td><td>8.7<\/td><td><a href=\"https:\/\/gradle.org\/releases\/\">Link<\/a><\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">\u00a0<\/figcaption><\/figure>\n\n\n\n<p>\u901a\u8fc7\u4e0a\u9762\u7684\u5b89\u88c5\u5305\u4e0b\u8f7d\u94fe\u63a5,\u4e0b\u8f7d\u540e\u8bf7\u76f4\u63a5\u5b89\u88c5\u5230\u672c\u5730\u673a\u5668\u5373\u53ef<\/p>\n\n\n\n<p>P.S \u5982\u679c\u662f\u81ea\u52a8\u5b89\u88c5\u5305,\u8bf7\u8bb0\u5f55\u4e00\u4e0b\u5b89\u88c5\u7684\u8def\u5f84,\u5982\u679c\u53ea\u662f\u4e2a\u538b\u7f29\u6587\u4ef6,\u8bf7\u628a\u6587\u4ef6\u89e3\u538b\u5e76\u4e14\u8bb0\u5f55\u653e\u7f6e\u7684\u8def\u5f84,\u4ee5\u4fbf\u540e\u7eed\u8bbe\u7f6e\u73af\u5883\u8fd0\u884c\u8def\u5f84<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">JAVA SDK\u5b89\u88c5<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"733\" src=\"http:\/\/tck0521.ddns.net:6789\/wp-content\/uploads\/2024\/05\/image-51-1024x733.png\" alt=\"\" class=\"wp-image-379\" srcset=\"https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-51-1024x733.png 1024w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-51-300x215.png 300w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-51-768x550.png 768w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-51.png 1240w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Java SDK\u5b89\u88c5\u5b8c\u6210\u4e4b\u540e,\u8def\u5f84\u662f\u5728\/Library\/Java\/JavaVirtualMachines\/jdk-21.jdk\/Contents\/Home, \u6240\u4ee5\u5728\u4f60\u7684\u542f\u52a8Profile\u6587\u4ef6 (i.e. .zshrc)\u91cc\u9762, \u52a0\u4e0a\u4ee5\u4e0b\u7684\u547d\u4ee4<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>JAVA_HOME=\/Library\/Java\/JavaVirtualMachines\/jdk-21.jdk\/Contents\/Home\nexport PATH=$PATH:\/$JAVA_HOME\/bin<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"194\" src=\"http:\/\/tck0521.ddns.net:6789\/wp-content\/uploads\/2024\/05\/image-37-1024x194.png\" alt=\"\" class=\"wp-image-362\" srcset=\"https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-37-1024x194.png 1024w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-37-300x57.png 300w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-37-768x146.png 768w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-37.png 1138w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u52a0\u8f7d.zshrc\u6587\u4ef6\u4e4b\u540e,\u8fd0\u884c&#8221;java &#8211;version&#8221;\u5c31\u53ef\u4ee5\u770b\u5230Java\u5df2\u7ecf\u5728\u7cfb\u7edf\u8def\u5f84\u91cc\u9762\u53ef\u4ee5\u968f\u65f6\u8c03\u7528\u4e86<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Maven\u5b89\u88c5<\/h3>\n\n\n\n<p>\u6211\u7684Maven\u662f\u76f4\u63a5\u4e0b\u8f7d\u89e3\u538b\u5305\u7684,\u6240\u4ee5\u89e3\u538b\u4e4b\u540e,\u5728.zshrc\u6587\u4ef6\u91cc\u9762\u52a0\u4e0a\u4ee5\u4e0b\u547d\u4ee4<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MAVEN_HOME=\/Users\/xxx\/Dev\/apache-maven-3.9.6\nexport PATH=$PATH:$MAVEN_HOME\/bin<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"161\" src=\"http:\/\/tck0521.ddns.net:6789\/wp-content\/uploads\/2024\/05\/image-38-1024x161.png\" alt=\"\" class=\"wp-image-363\" srcset=\"https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-38-1024x161.png 1024w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-38-300x47.png 300w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-38-768x121.png 768w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-38-1536x241.png 1536w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-38.png 1708w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u52a0\u8f7d.zshrc\u6587\u4ef6\u4e4b\u540e,\u8fd0\u884c&#8221;mvn -version&#8221;\u5c31\u53ef\u4ee5\u770b\u5230Maven\u5df2\u7ecf\u5728\u7cfb\u7edf\u8def\u5f84\u91cc\u9762\u53ef\u4ee5\u968f\u65f6\u8c03\u7528\u4e86<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Gradle \u5b89\u88c5<\/h3>\n\n\n\n<p>Gradle\u5b89\u88c5\u597d\u4e4b\u540e,\u8bf7\u4e5f\u5728.zshrc\u6587\u4ef6\u91cc\u9762\u63d2\u5165\u4e0b\u9762\u7684\u547d\u4ee4<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>GRADLE_HOME=\/opt\/gradle\/gradle-8.7\nexport PATH=$PATH:$GRADLE_HOME\/bin\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"491\" src=\"http:\/\/tck0521.ddns.net:6789\/wp-content\/uploads\/2024\/05\/image-39-1024x491.png\" alt=\"\" class=\"wp-image-364\" srcset=\"https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-39-1024x491.png 1024w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-39-300x144.png 300w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-39-768x368.png 768w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-39.png 1134w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u52a0\u8f7d.zshrc\u6587\u4ef6\u4e4b\u540e,\u8fd0\u884c&#8221;gradle -version&#8221;\u5c31\u53ef\u4ee5\u770b\u5230Gradle\u5df2\u7ecf\u5728\u7cfb\u7edf\u8def\u5f84\u91cc\u9762\u53ef\u4ee5\u968f\u65f6\u8c03\u7528\u4e86<\/p>\n\n\n\n<p>\u5230\u8fd9\u91cc\u4f60\u7684\u672c\u5730\u8fd0\u884c\u73af\u5883\u57fa\u672c\u4e0a\u5c31\u5dee\u4e0d\u591a\u4e86<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Spring boot \u9879\u76ee\u521b\u5efa<\/h2>\n\n\n\n<p>\u8fd9\u91cc\u6211\u4f1a\u4ecb\u7ecd\u4e24\u79cd\u65b9\u6cd5: <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Spring CLI<\/strong>: Spring CLI\uff08\u547d\u4ee4\u884c\u754c\u9762\uff09\u662f\u4e00\u4e2a\u57fa\u4e8e\u6587\u672c\u7684\u5de5\u5177\uff0c\u7528\u4e8e\u4e0e Spring \u751f\u6001\u7cfb\u7edf\u4ea4\u4e92\u3002\u5b83\u5141\u8bb8\u5f00\u53d1\u4eba\u5458\u4ece\u547d\u4ee4\u884c\u6267\u884c\u5404\u79cd\u4efb\u52a1\uff0c\u5305\u62ec\uff1a\u521b\u5efa\u65b0\u7684 Spring Boot \u9879\u76ee, \u8fd0\u884c Spring Boot \u5e94\u7528\u7a0b\u5e8f, \u7ba1\u7406 Spring Boot \u5e94\u7528\u7a0b\u5e8f\u7684\u4f9d\u8d56\u9879, \u8c03\u8bd5 Spring Boot \u5e94\u7528\u7a0b\u5e8f, \u4e0e Spring Cloud \u670d\u52a1\u4ea4\u4e92. \u7b80\u5355\u6765\u8bf4Spring CLI \u63d0\u4f9b\u4e86\u4e00\u4e2a\u65b9\u4fbf\u4e14\u9ad8\u6548\u7684\u65b9\u5f0f\u6765\u7ba1\u7406\u548c\u5f00\u53d1 Spring \u5e94\u7528\u7a0b\u5e8f\uff0c\u65e0\u9700\u4f7f\u7528\u56fe\u5f62\u7528\u6237\u754c\u9762 (GUI)\u3002<\/li>\n\n\n\n<li><strong>Spring Initializr<\/strong>: Spring Initializr \u662f\u4e00\u4e2a\u5728\u7ebf\u5de5\u5177\uff0c\u5141\u8bb8\u5f00\u53d1\u4eba\u5458\u5feb\u901f\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 Spring Boot \u9879\u76ee\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u754c\u9762\uff0c\u5f00\u53d1\u4eba\u5458\u53ef\u4ee5\u5728\u5176\u4e2d\u9009\u62e9\u6240\u9700\u7684\u4f9d\u8d56\u9879\u548c\u6a21\u5757\uff0c\u5e76\u751f\u6210\u4e00\u4e2a\u5305\u542b\u6240\u6709\u5fc5\u8981\u914d\u7f6e\u548c\u4f9d\u8d56\u9879\u7684\u9879\u76ee\u811a\u624b\u67b6\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Spring CLI<\/h3>\n\n\n\n<p>\u5b98\u65b9\u662f\u6709\u6559\u7a0b\u6307\u5bfc\u600e\u4e48\u5b89\u88c5Spring CLI\u7684, \u53ef\u4ee5\u53c2\u8003:<a href=\"https:\/\/docs.spring.io\/spring-cli\/reference\/installation.html\">https:\/\/docs.spring.io\/spring-cli\/reference\/installation.html<\/a> <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"369\" src=\"http:\/\/tck0521.ddns.net:6789\/wp-content\/uploads\/2024\/05\/image-40-1024x369.png\" alt=\"\" class=\"wp-image-366\" srcset=\"https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-40-1024x369.png 1024w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-40-300x108.png 300w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-40-768x277.png 768w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-40-1536x554.png 1536w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-40-2048x739.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u4f46\u6211\u60f3\u8bf4\u7684\u662f,brew\u5728\u6211\u7684\u673a\u5668\u4e0a\u8fd0\u884c\u8d77\u6765\u6bd4\u8f83\u8d39\u52b2,\u6240\u4ee5\u6211\u5efa\u8bae\u5927\u5bb6\u53ef\u4ee5\u76f4\u63a5\u53c2\u8003\u6559\u7a0b\u91cc\u9762\u81ea\u884cgit pull\u62c9\u53d6Spring CLI\u5728Github\u4e0a\u7684\u6e90\u4ee3\u7801,\u672c\u5730\u7528Gradle\u76f4\u63a5\u6784\u5efa\u5c31\u597d\u4e86<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"577\" src=\"http:\/\/tck0521.ddns.net:6789\/wp-content\/uploads\/2024\/05\/image-41-1024x577.png\" alt=\"\" class=\"wp-image-367\" srcset=\"https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-41-1024x577.png 1024w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-41-300x169.png 300w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-41-768x433.png 768w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-41-1536x865.png 1536w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-41-1280x720.png 1280w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-41.png 1718w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>\u7528git clone\u628a\u4ee3\u7801\u62c9\u53d6\u5230\u672c\u5730\u4e4b\u540e,\u53bb\u5230\u8be5\u4ee3\u7801\u7684\u6839\u76ee\u5f55\u8fd0\u884c\".\/gradlew clean build -x test\", \u770b\u5230<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">BUILD SUCCESSFUL<\/mark><\/strong>\u7684\u5b57\u6837\u5c31\u4ee3\u8868Spring CLI\u7684jar\u6587\u4ef6\u5df2\u7ecf\u88ab\u521b\u5efa\u597d,\u5e76\u4e14\u53ef\u4ee5\u4f7f\u7528\u4e86.<\/code><\/pre>\n\n\n\n<p>Spring CLI\u7684Jar\u5305\u51c6\u5907\u597d\u4e4b\u540e, \u9700\u8981\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4,\u628aSpring CLI\u7684\u529f\u80fd\u5c01\u88c5\u6210\u4e00\u4e2a&#8221;spring&#8221;\u7684\u5feb\u6377\u547d\u4ee4<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>alias spring='java -jar $HOME\/temp\/spring-cli\/build\/libs\/spring-cli-0.8.1.jar'<\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u6211\u4eec\u60f3\u6784\u5efa\u4e00\u4e2aSpring AI\u7684\u9879\u76ee,\u53ef\u4ee5\u53c2\u8003\u8fd9\u4e2a\u6559\u7a0b: <a href=\"https:\/\/spring.io\/projects\/spring-ai#overview\">https:\/\/spring.io\/projects\/spring-ai#overview<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"378\" src=\"http:\/\/tck0521.ddns.net:6789\/wp-content\/uploads\/2024\/05\/image-42-1024x378.png\" alt=\"\" class=\"wp-image-368\" srcset=\"https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-42-1024x378.png 1024w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-42-300x111.png 300w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-42-768x283.png 768w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-42-1536x567.png 1536w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-42.png 2038w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u91cc\u9762\u8bf4\u5230\u53ea\u9700\u8981\u8fd0\u884c\u4ee5\u4e0b\u7684\u547d\u4ee4,\u9879\u76ee\u5c31\u76f4\u63a5\u521b\u5efa\u51fa\u6765\u4e86<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>alias spring=java\\ -jar\\ ~\/Dev\/spring\/build\/libs\/spring-cli-0.9.0-SNAPSHOT.jar\nspring boot new --from ai --name myai<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"428\" src=\"http:\/\/tck0521.ddns.net:6789\/wp-content\/uploads\/2024\/05\/image-44-1024x428.png\" alt=\"\" class=\"wp-image-370\" srcset=\"https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-44-1024x428.png 1024w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-44-300x125.png 300w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-44-768x321.png 768w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-44.png 1336w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u4ee5\u4e0a\u662f\u6211\u672c\u5730\u8fd0\u884c\u7684\u6548\u679c<\/p>\n\n\n\n<p>\u5230\u8fd9\u91cc\u4f60\u7684Spring boot\u9879\u76ee\u6846\u67b6\u5c31\u521b\u5efa\u597d\u4e86<\/p>\n\n\n\n<p>\u5982\u679c\u4f60\u5df2\u7ecf\u6709\u4e00\u4e2aSpring\u9879\u76ee, \u60f3\u628aSpring AI\u7684\u6a21\u5757\u52a0\u5230\u4f60\u73b0\u6709\u7684\u9879\u76ee\u91cc\u9762,\u53ef\u4ee5\u53c2\u8003\u8fd9\u91cc\u7684\u6559\u7a0b<a href=\"https:\/\/docs.spring.io\/spring-ai\/reference\/getting-started.html\">https:\/\/docs.spring.io\/spring-ai\/reference\/getting-started.html<\/a>. \u5728\u73b0\u6709\u7684\u9879\u76ee\u91cc\u9762\u76f4\u63a5\u8fd0\u884c\u4e00\u4e0b\u6307\u4ee4\u6765\u589e\u52a0\u8fd9\u4e2a\u6a21\u5757<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>spring boot add ai<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"> Spring Initializr<\/h3>\n\n\n\n<p> Spring Initializr \u662f\u4e00\u4e2a\u7528\u4e8e\u5feb\u901f\u521b\u5efa\u65b0\u7684 Spring Boot \u9879\u76ee\u7684\u5728\u7ebf\u5de5\u5177\u3002\u5b83\u5141\u8bb8\u5f00\u53d1\u4eba\u5458\u9009\u62e9\u6240\u9700\u7684\u4f9d\u8d56\u9879\u548c\u914d\u7f6e\uff0c\u5e76\u81ea\u52a8\u751f\u6210\u4e00\u4e2a\u57fa\u672c\u7684\u9879\u76ee\u7ed3\u6784\u3002\u5b83\u7684\u7f51\u5740\u662f<a href=\"https:\/\/start.spring.io\/\">https:\/\/start.spring.io\/<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"579\" src=\"http:\/\/tck0521.ddns.net:6789\/wp-content\/uploads\/2024\/05\/image-45-1024x579.png\" alt=\"\" class=\"wp-image-371\" srcset=\"https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-45-1024x579.png 1024w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-45-300x170.png 300w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-45-768x435.png 768w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-45-1536x869.png 1536w, https:\/\/tck0521.dpdns.org\/wp-content\/uploads\/2024\/05\/image-45-2048x1159.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u8fdb\u5165\u5230Spring Initializr, \u4f60\u53ef\u4ee5\u770b\u5230\u4ee5\u4e0a\u7684\u754c\u9762<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u533a\u57df1: \u9009\u62e9\u4f60\u60f3\u6784\u5efa\u8fd9\u4e2a\u9879\u76ee\u7684\u6784\u5efa\u5de5\u5177(e.g. Gradle, Maven), \u8bed\u8a00(e.g.Java, Kotlin)\u548cSpring Boot\u7684\u7248\u672c<\/li>\n\n\n\n<li>\u533a\u57df2: \u8bbe\u7f6e\u4f60\u8fd9\u4e2a\u9879\u76ee\u7684\u4fe1\u606f(e.g. \u540d\u79f0,\u63cf\u8ff0,\u5305\u540d \u7b49\u7b49)\u4ee5\u53ca\u9879\u76ee\u8fd0\u884c\u7684JAVA\u7248\u672c(e.g. 22, 21, 17)<\/li>\n\n\n\n<li>\u533a\u57df3: \u9009\u62e9\u4f60\u5e0c\u671b\u8fd9\u4e2a\u9879\u76ee\u5305\u542b\u4ec0\u4e48Spring\u7684\u6a21\u5757(e.g. Open AI, Spring Web, JDBC etc)<\/li>\n<\/ul>\n\n\n\n<p>\u8bbe\u7f6e\u597d\u4e4b\u540e,\u5c31\u53ef\u4ee5\u70b9\u51fb\u4e0b\u65b9\u7684Generate\u6309\u94ae, \u8fd9\u6837Spring Initializr\u5c31\u4f1a\u628a\u4f60\u521a\u521a\u7684\u8bbe\u7f6e\u6784\u5efa\u4e00\u4e2aSpring boot\u7684\u6846\u67b6\u5e76\u6253\u5305\u6210\u4e00\u4e2azip\u5305\u4e0b\u8f7d\u5230\u4f60\u672c\u5730, \u4f60\u53ea\u9700\u8981\u628a\u538b\u7f29\u5305\u89e3\u538b\u5230\u4f60\u6307\u5b9a\u7684\u9879\u76ee\u76ee\u5f55\u5373\u53ef<\/p>\n\n\n\n<p>\u5230\u8fd9\u91cc,\u4f60\u7684Spring boot\u9879\u76ee\u6846\u67b6\u5c31\u5df2\u7ecf\u51c6\u5907\u597d, \u53ef\u4ee5\u4f7f\u7528IDE\u8fdb\u884c\u9879\u76ee\u7684\u5f00\u53d1\u4e86<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spring Boot \u662f\u4e00\u4e2a&hellip;<\/p>\n","protected":false},"author":2,"featured_media":376,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-360","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-2"],"_links":{"self":[{"href":"https:\/\/tck0521.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tck0521.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tck0521.dpdns.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tck0521.dpdns.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/tck0521.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=360"}],"version-history":[{"count":8,"href":"https:\/\/tck0521.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/360\/revisions"}],"predecessor-version":[{"id":386,"href":"https:\/\/tck0521.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/360\/revisions\/386"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tck0521.dpdns.org\/index.php?rest_route=\/wp\/v2\/media\/376"}],"wp:attachment":[{"href":"https:\/\/tck0521.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tck0521.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tck0521.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}