{"id":21377,"date":"2025-04-19T04:31:37","date_gmt":"2025-04-18T20:31:37","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/21377.html"},"modified":"2025-04-19T04:31:37","modified_gmt":"2025-04-18T20:31:37","slug":"springboot%e6%89%93%e5%8c%85%e9%83%a8%e7%bd%b2%e5%88%b0%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%ae%9d%e5%a1%94%e9%9d%a2%e6%9d%bf","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/21377.html","title":{"rendered":"Springboot\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668(\u5b9d\u5854\u9762\u677f)"},"content":{"rendered":"<p>\u76ee\u7684&#xff1a;java\u9879\u76ee\u6253\u5305\u6210jar\u5305&#xff0c; \u653e\u5728\u670d\u52a1\u5668\u4e0a\u53bb\u8fd0\u884c&#xff0c;\u5e76\u4e14\u4f7f\u7528\u57df\u540d\u4f5c\u4e3a\u540e\u7aef\u63a5\u53e3<\/p>\n<p>\u00a0<\/p>\n<h3>\u4e00\u3001\u7f16\u5199\u6253\u5305\u914d\u7f6e<\/h3>\n<h4>1. pom.xml<\/h4>\n<p>\u5728\u9879\u76ee\u4e2d\u7684pom.xml\u6587\u4ef6\u91cc\u9762\u4fee\u6539&lt;build&gt;&#8230;&lt;\/build&gt;\u7684\u4ee3\u7801<\/p>\n<p>&lt;build&gt;<br \/>\n  &lt;!&#8211;\u6253\u5305\u914d\u7f6e&#8211;&gt;<br \/>\n  &lt;finalName&gt;p-school-api&lt;\/finalName&gt;<br \/>\n  &lt;plugins&gt;<br \/>\n    &lt;plugin&gt;<br \/>\n      &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;<br \/>\n      &lt;artifactId&gt;spring-boot-maven-plugin&lt;\/artifactId&gt;<br \/>\n      &lt;version&gt;2.3.0.RELEASE&lt;\/version&gt;<br \/>\n      &lt;!&#8211;                \u6b63\u786e\u6253\u5305\u672c\u5730\u52a0\u5bc6jar\u5305&#xff0c;\u4e0d\u53ef\u5220\u9664&#8211;&gt;<br \/>\n      &lt;configuration&gt;<br \/>\n        &lt;jvmArguments&gt;-Dfile.encoding&#061;UTF-8&lt;\/jvmArguments&gt;<br \/>\n        &lt;fork&gt;true&lt;\/fork&gt;<br \/>\n        &lt;includeSystemScope&gt;true&lt;\/includeSystemScope&gt;<br \/>\n      &lt;\/configuration&gt;<br \/>\n      &lt;executions&gt;<br \/>\n        &lt;execution&gt;<br \/>\n          &lt;goals&gt;<br \/>\n            &lt;goal&gt;repackage&lt;\/goal&gt;&lt;!&#8211;\u53ef\u4ee5\u628a\u4f9d\u8d56\u7684\u5305\u90fd\u6253\u5305\u5230\u751f\u6210\u7684Jar\u5305\u4e2d&#8211;&gt;<br \/>\n          &lt;\/goals&gt;<br \/>\n        &lt;\/execution&gt;<br \/>\n      &lt;\/executions&gt;<br \/>\n    &lt;\/plugin&gt;<\/p>\n<p>    &lt;plugin&gt;<br \/>\n      &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;<br \/>\n      &lt;artifactId&gt;maven-resources-plugin&lt;\/artifactId&gt;<br \/>\n      &lt;configuration&gt;<br \/>\n        &lt;!&#8211; \u4f7f\u7528\u9ed8\u8ba4\u7684\u53d8\u91cf\u6807\u8bb0\u65b9\u6cd5\u5373${*} &#8211;&gt;<br \/>\n        &lt;useDefaultDelimiters&gt;true&lt;\/useDefaultDelimiters&gt;<br \/>\n        &lt;nonFilteredFileExtensions&gt;<br \/>\n          &lt;nonFilteredFileExtension&gt;woff&lt;\/nonFilteredFileExtension&gt;<br \/>\n          &lt;nonFilteredFileExtension&gt;woff2&lt;\/nonFilteredFileExtension&gt;<br \/>\n          &lt;nonFilteredFileExtension&gt;eot&lt;\/nonFilteredFileExtension&gt;<br \/>\n          &lt;nonFilteredFileExtension&gt;ttf&lt;\/nonFilteredFileExtension&gt;<br \/>\n          &lt;nonFilteredFileExtension&gt;svg&lt;\/nonFilteredFileExtension&gt;<br \/>\n        &lt;\/nonFilteredFileExtensions&gt;<br \/>\n      &lt;\/configuration&gt;<br \/>\n    &lt;\/plugin&gt;<br \/>\n  &lt;\/plugins&gt;<\/p>\n<p>  &lt;resources&gt;<br \/>\n    &lt;!&#8211;            &lt;resource&gt;&#8211;&gt;<br \/>\n    &lt;!&#8211;                &lt;directory&gt;src\/main\/resources&lt;\/directory&gt;&#8211;&gt;<br \/>\n    &lt;!&#8211;                &amp;lt;!&amp;ndash; \u5904\u7406\u6587\u4ef6\u65f6\u66ff\u6362\u6587\u4ef6\u4e2d\u7684\u53d8\u91cf &amp;ndash;&amp;gt;&#8211;&gt;<br \/>\n    &lt;!&#8211;                &lt;filtering&gt;true&lt;\/filtering&gt;&#8211;&gt;<br \/>\n    &lt;!&#8211;                &lt;excludes&gt;&#8211;&gt;<br \/>\n    &lt;!&#8211;                    &amp;lt;!&amp;ndash; \u6253\u5305\u65f6\u6392\u9664\u6587\u4ef6 &amp;ndash;&amp;gt;&#8211;&gt;<br \/>\n    &lt;!&#8211;&amp;lt;!&amp;ndash;                    &lt;exclude&gt;application.yml&lt;\/exclude&gt;&amp;ndash;&amp;gt;&#8211;&gt;<br \/>\n    &lt;!&#8211;                    &lt;exclude&gt;application-{profile}.yml&lt;\/exclude&gt;&#8211;&gt;<br \/>\n    &lt;!&#8211;&amp;lt;!&amp;ndash;                    &lt;exclude&gt;application-beta.yml&lt;\/exclude&gt;&amp;ndash;&amp;gt;&#8211;&gt;<br \/>\n    &lt;!&#8211;&amp;lt;!&amp;ndash;                    &lt;exclude&gt;application-prod.yml&lt;\/exclude&gt;&amp;ndash;&amp;gt;&#8211;&gt;<br \/>\n    &lt;!&#8211;                &lt;\/excludes&gt;&#8211;&gt;<br \/>\n    &lt;!&#8211;            &lt;\/resource&gt;&#8211;&gt;<br \/>\n    &lt;resource&gt;<br \/>\n      &lt;directory&gt;src\/main\/resources&lt;\/directory&gt;<br \/>\n      &lt;filtering&gt;true&lt;\/filtering&gt;<br \/>\n    &lt;\/resource&gt;<br \/>\n    &lt;!&#8211;            &lt;resource&gt;&#8211;&gt;<br \/>\n    &lt;!&#8211;                &lt;directory&gt;src\/main\/resources.${spring.profiles.active}&lt;\/directory&gt;&#8211;&gt;<br \/>\n    &lt;!&#8211;                &lt;filtering&gt;false&lt;\/filtering&gt;&#8211;&gt;<br \/>\n    &lt;!&#8211;            &lt;\/resource&gt;&#8211;&gt;<br \/>\n    &lt;!&#8211;\u8fd9\u4e2a\u5143\u7d20\u63cf\u8ff0\u4e86\u9879\u76ee\u76f8\u5173\u7684\u6240\u6709\u8d44\u6e90\u8def\u5f84\u5217\u8868&#xff0c;\u4f8b\u5982\u548c\u9879\u76ee\u76f8\u5173\u7684\u5c5e\u6027\u6587\u4ef6&#xff0c;\u8fd9\u4e9b\u8d44\u6e90\u88ab\u5305\u542b\u5728\u6700\u7ec8\u7684\u6253\u5305\u6587\u4ef6\u91cc\u3002&#8211;&gt;<br \/>\n    &lt;resource&gt;<br \/>\n      &lt;!&#8211;   \u63cf\u8ff0\u5b58\u653e\u8d44\u6e90\u7684\u76ee\u5f55&#xff0c;\u8be5\u8def\u5f84\u76f8\u5bf9POM\u8def\u5f84&#8211;&gt;<br \/>\n      &lt;directory&gt;src\/main\/java&lt;\/directory&gt;<br \/>\n      &lt;includes&gt;<br \/>\n        &lt;include&gt;**\/*.xml&lt;\/include&gt;<br \/>\n      &lt;\/includes&gt;<br \/>\n    &lt;\/resource&gt;<\/p>\n<p>    &lt;resource&gt;<br \/>\n      &lt;filtering&gt;true&lt;\/filtering&gt;<br \/>\n      &lt;directory&gt;src\/main\/resources&lt;\/directory&gt;<br \/>\n      &lt;excludes&gt;<br \/>\n        &lt;exclude&gt;**\/*.woff&lt;\/exclude&gt;<br \/>\n        &lt;exclude&gt;**\/*.ttf&lt;\/exclude&gt;<br \/>\n        &lt;exclude&gt;**\/*.eot&lt;\/exclude&gt;<br \/>\n        &lt;exclude&gt;**\/*.svg&lt;\/exclude&gt;<br \/>\n      &lt;\/excludes&gt;<br \/>\n    &lt;\/resource&gt;<br \/>\n  &lt;\/resources&gt;<br \/>\n&lt;\/build&gt; <\/p>\n<h4>2. \u7f16\u5199application-prod.yml\u6587\u4ef6<\/h4>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203131-6802b6a37f0fa.png\" alt=\"26d7433bb1bfd894418e466db9511d5c.png\" \/><\/p>\n<p>application-prod.yml\u6587\u4ef6\u548capplication.yml\u6587\u4ef6\u7684\u4ee3\u7801\u57fa\u672c\u4e00\u81f4&#xff0c;\u53ea\u9700\u8981\u628a\u4e00\u4e9b\u672c\u5730\u7684\u5730\u5740\u6539\u6210\u7ebf\u4e0a\u7684&#xff0c; \u4f8b\u5982&#xff1a;\u6570\u636e\u5e93\u5730\u5740&#xff0c;Redis\u5730\u5740\u8fd9\u4e9b\u4ee5\u53ca\u7528\u6237\u540d\u5bc6\u7801<\/p>\n<h3>\u4e8c\u3001\u6253\u5305\u9879\u76ee<\/h3>\n<p>\u5728idea\u4e2d&#xff0c;\u4f7f\u7528maven\u8fdb\u884c\u6253\u5305<\/p>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203131-6802b6a39ee88.png\" alt=\"215b321a676c1bc9d31937069d8ac3e9.png\" \/><\/p>\n<p>\u6253\u5305\u8fc7\u7a0b<\/p>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203131-6802b6a3c4714.png\" alt=\"45627f257a1c4ebb863cfd359101737b.png\" \/><\/p>\n<p>\u6253\u5305\u5b8c\u6210<\/p>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203132-6802b6a42fab5.png\" alt=\"835010c1ec972eebfeb6e4b61f7a8f1a.png\" \/><\/p>\n<p>\u6253\u5305\u597d\u7684\u6587\u4ef6<\/p>\n<p>\u5728\u4f60\u9879\u76ee\u4e2d\u7684target\u6587\u4ef6\u5939\u91cc\u9762<\/p>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203132-6802b6a4a2020.png\" alt=\"7ce0834eb11884c33160aa47a3424fc9.png\" \/><\/p>\n<h3>\u4e09\u3001\u4e0a\u4f20\u5230\u670d\u52a1\u5668<\/h3>\n<h4>\u786e\u4fdd\u5df2\u5b89\u88c5\u4e86java\u73af\u5883<\/h4>\n<p>\u6ca1\u6709\u5b89\u88c5\u7684\u8bdd\u5c31\u6309\u4e0b\u56fe\u63d0\u793a\u5b89\u88c5<\/p>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203132-6802b6a4d9cf6.png\" alt=\"ff95b54766c49fbfd42005b67c963765.png\" \/><\/p>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203133-6802b6a57c17d.png\" alt=\"cb0e1f706cf47bb7ee3803d46c955408.png\" \/><\/p>\n<h4>1. \u5efa\u7acb\u540e\u7aef\u7ad9\u70b9<\/h4>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203133-6802b6a5b934d.png\" alt=\"44ef25ae1d75e0a82cd79e4c934fb4b5.png\" \/><\/p>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203133-6802b6a5d81d3.png\" alt=\"1b24fbb206ff143f575e21e6ff9850cf.png\" \/><\/p>\n<p>\u57df\u540d\u9700\u8981\u89e3\u6790<\/p>\n<h4>2. \u8bbe\u7f6e\u53cd\u5411\u4ee3\u7406<\/h4>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203134-6802b6a6231ba.png\" alt=\"e32332dd1456f75dbfe549612ef2c425.png\" \/><\/p>\n<p>\u7aef\u53e3\u53f7\u662fapplication-prod.yml\u6587\u4ef6\u91cc\u9762\u7684\u7aef\u53e3\u53f7<\/p>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203134-6802b6a68d0d9.png\" alt=\"7b38bd37d6483a0b04352be36d548e3e.png\" \/><\/p>\n<h4>3. \u4e0a\u4f20\u6253\u5305\u7684\u597djar\u5305\u5230\u521a\u521a\u521b\u5efa\u597d\u7684\u6587\u4ef6\u5939\u91cc\u9762<\/h4>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203134-6802b6a6ed3d1.png\" alt=\"e51fc7f54e0a60afc84463ffdf9e28f9.png\" \/><\/p>\n<h3>\u56db\u3001\u7f16\u5199\u542f\u52a8\/\u505c\u6b62\u811a\u672c<\/h3>\n<h4>1. \u542f\u52a8\u811a\u672c<\/h4>\n<p>#!\/bin\/bash<\/p>\n<p>#\u5f00\u59cb\u65f6\u95f4 \u65f6\u95f4\u6233<br \/>\nstartTime&#061;&#096;date &#043;&#039;%Y-%m-%d %H:%M:%S&#039;&#096;<\/p>\n<p>#\u63a5\u53e3\u9879\u76ee\u7ad9\u70b9\u8def\u5f84&#xff08;\u76ee\u5f55\u6309\u7167\u5404\u81ea\u914d\u7f6e&#xff09;<br \/>\nAPP_PATH&#061;\/www\/wwwroot\/\u5b58\u653ejar\u7684\u8def\u5f84<\/p>\n<p>#jar\u5305\u6587\u4ef6\u540d\u79f0<br \/>\nAPP_NAME&#061;$APP_PATH\/\u81ea\u5df1\u6253\u5305\u597djar\u5305\u7684\u540d\u5b57.jar<\/p>\n<p>#\u65e5\u5fd7\u6587\u4ef6\u540d\u79f0<br \/>\nLOG_FILE&#061;$APP_PATH\/deco_out.log<\/p>\n<p>#\u542f\u52a8\u73af\u5883   # \u5982\u679c\u9700\u8981\u914d\u7f6e\u6570\u636e\u548credis&#xff0c;\u8bf7\u5728 application-prod.yml\u4e2d\u4fee\u6539, \u7528jar\u547d\u4ee4\u4fee\u6539\u5373\u53ef<br \/>\nAPP_YML&#061;&#8211;spring.profiles.active&#061;prod<\/p>\n<p>#\u6570\u636e\u5e93\u914d\u7f6e<\/p>\n<p>rm -rf $LOG_FILE<\/p>\n<p>echo &#034;\u5f00\u59cb\u505c\u6b62 deco \u9879\u76ee\u8fdb\u7a0b&#034;<br \/>\n#\u67e5\u8be2\u8fdb\u7a0b&#xff0c;\u5e76\u6740\u6389\u5f53\u524djar\/java\u7a0b\u5e8f<\/p>\n<p>pid&#061;&#096;ps -ef|grep $APP_NAME | grep -v grep | awk &#039;{print $2}&#039;&#096;<br \/>\nif [ $pid ];then<br \/>\n  echo &#034;pid: $pid&#034;<br \/>\n  kill -9 $pid<br \/>\n  echo &#034;deco \u9879\u76ee\u8fdb\u7a0b\u8fdb\u7a0b\u7ec8\u6b62\u6210\u529f&#034;<br \/>\nfi<\/p>\n<p>sleep 2<\/p>\n<p>#\u5224\u65adjar\u5305\u6587\u4ef6\u662f\u5426\u5b58\u5728&#xff0c;\u5982\u679c\u5b58\u5728\u542f\u52a8jar\u5305&#xff0c;\u5e76\u65f6\u65f6\u67e5\u770b\u542f\u52a8\u65e5\u5fd7<\/p>\n<p>if test -e $APP_NAME;then<br \/>\n  echo &#039;\u6587\u4ef6\u5b58\u5728,\u5f00\u59cb\u542f\u52a8\u6b64\u7a0b\u5e8f&#8230;&#039;<\/p>\n<p># \u542f\u52a8jar\u5305&#xff0c;\u6307\u5411\u65e5\u5fd7\u6587\u4ef6&#xff0c;2&gt;&amp;1 &amp; \u8868\u793a\u6253\u5f00\u6216\u6307\u5411\u540c\u4e00\u4e2a\u65e5\u5fd7\u6587\u4ef6  &#8211;spring.profiles.active&#061;prod \u542f\u52a8 prod\u73af\u5883<\/p>\n<p>  nohup java -jar $APP_NAME $APP_YML  &gt; deco_out.log 2&gt;&amp;1 &amp;<br \/>\n  echo &#034;\u6b63\u5728\u53d1\u5e03\u4e2d&#xff0c;\u8bf7\u7a0d\u540e&#8230;&#8230;&#034;<br \/>\n  sleep 10s<\/p>\n<p>  #\u901a\u8fc7\u68c0\u6d4b\u65e5\u5fd7\u6765\u5224\u65ad<br \/>\n  while [ -f $LOG_FILE ]<br \/>\n  do<br \/>\n      success&#061;&#096;grep &#034;Started KxtAdminApplication in &#034; $LOG_FILE&#096;<br \/>\n      if [[ &#034;$success&#034; !&#061; &#034;&#034; ]]<br \/>\n      then<br \/>\n#          echo &#034;deco start &#8230;&#8230;&#8230;&#034;<br \/>\n          break<br \/>\n      else<br \/>\n#          echo &#034;deco Running &#8230;&#8230;.&#034;<br \/>\n          sleep 1s<br \/>\n      fi<\/p>\n<p>#      echo &#034;\u5f00\u59cb\u68c0\u6d4b\u542f\u52a8\u5931\u8d25\u6807\u8bb0&#034;<br \/>\n      fail&#061;&#096;grep &#034;Fail&#034; $LOG_FILE&#096;<br \/>\n      if [[ &#034;$fail&#034; !&#061; &#034;&#034; ]]<br \/>\n      then<br \/>\n          echo &#034;\u9879\u76ee\u542f\u52a8\u5931\u8d25&#034;<br \/>\n          tail -f $LOG_FILE<br \/>\n          break<br \/>\n      else<br \/>\n#          echo &#034;KXT Running &#8230;&#8230;.&#034;<br \/>\n          sleep 1s<br \/>\n      fi<\/p>\n<p>  done<br \/>\n  echo &#034;deco Started Success&#034;<\/p>\n<p>endTime&#061;&#096;date &#043;&#039;%Y-%m-%d %H:%M:%S&#039;&#096;<br \/>\nstartSecond&#061;$(date &#8211;date&#061;&#034;$startTime&#034; &#043;%s);<br \/>\nendSecond&#061;$(date &#8211;date&#061;&#034;$endTime&#034; &#043;%s);<\/p>\n<p>total&#061;$((endSecond-startSecond))<br \/>\n# shellcheck disable&#061;SC2027<br \/>\necho &#034;\u672c\u6b21\u8fd0\u884c\u65f6\u95f4&#xff1a; &#034;$total&#034;s&#034;<br \/>\n# shellcheck disable&#061;SC2086<br \/>\necho &#034;\u5f53\u524d\u65f6\u95f4&#xff1a;&#034;$endTime<\/p>\n<p>else<br \/>\n  echo &#039;$APP_NAME \u6587\u4ef6\u4e0d\u5b58\u5728,\u8bf7\u68c0\u67e5\u3002&#039;<br \/>\nfi<\/p>\n<p>#\u5728 $APP_NAME \u540c\u7ea7\u76ee\u5f55\u4e0b\u8fd0\u884c  .\/startAdmin.sh \u547d\u4ee4\u5373\u53ef\u542f\u52a8\u9879\u76ee\u3002<\/p>\n<h4>2. \u505c\u6b62\u811a\u672c<\/h4>\n<p>#\u63a5\u53e3\u9879\u76ee\u7ad9\u70b9\u8def\u5f84&#xff08;\u76ee\u5f55\u6309\u7167\u5404\u81ea\u914d\u7f6e&#xff09;<br \/>\nAPP_PATH&#061;\/www\/wwwroot\/\u5b58\u653ejar\u7684\u8def\u5f84<\/p>\n<p>#jar\u5305\u6587\u4ef6\u540d\u79f0<br \/>\nAPP_NAME&#061;$APP_PATH\/\u81ea\u5df1\u6253\u5305\u597djar\u5305\u7684\u540d\u5b57.jar<\/p>\n<p>echo &#034;\u5f00\u59cb\u505c\u6b62 deco-admin \u9879\u76ee\u8fdb\u7a0b&#034;<br \/>\n#\u67e5\u8be2\u8fdb\u7a0b&#xff0c;\u5e76\u6740\u6389\u5f53\u524djar\/java\u7a0b\u5e8f<\/p>\n<p>pid&#061;&#096;ps -ef|grep $APP_NAME | grep -v grep | awk &#039;{print $2}&#039;&#096;<\/p>\n<p>echo &#034;pid: $pid &#034;<\/p>\n<p>if [ $pid ];then<br \/>\n  echo &#034;pid: $pid&#034;<br \/>\n  kill -9 $pid<br \/>\n  echo &#034;deco \u9879\u76ee\u8fdb\u7a0b\u8fdb\u7a0b\u7ec8\u6b62\u6210\u529f&#034;<br \/>\nelse<br \/>\n  echo &#034;\u672a\u627e\u5230\u5bf9\u5e94\u670d\u52a1&#034;<br \/>\nfi<\/p>\n<h3>\u4e94\u3001\u542f\u52a8\u9879\u76ee<\/h3>\n<h4>1. \u8fdb\u5165\u7ec8\u7aef<\/h4>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203135-6802b6a743634.png\" alt=\"959d8b9f76825861f8b9f9f7066bc275.png\" \/><\/p>\n<h4>2. \u8fdb\u5165\u5b58\u653ejar\u7684\u76ee\u5f55<\/h4>\n<p>2.1. \u4f7f\u7528\u547d\u4ee4\u8fdb\u5165\u76f8\u5e94\u7684\u76ee\u5f55<\/p>\n<p>cd \/www\/wwwroot\/\u4f60\u7684jar\u5305\u8def\u5f84 <\/p>\n<p>2.2. \u542f\u52a8\u811a\u672c<\/p>\n<p>.\/startAdmin.sh <\/p>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203135-6802b6a7c6ec6.png\" alt=\"14b9f86797548b83aeb5e7c4c0276501.png\" \/><\/p>\n<p>\u5982\u679c\u4e00\u76f4\u505c\u7559\u5728\u8fd9\u91cc&#xff0c; \u53ef\u4ee5\u53bb\u770b\u770b\u65e5\u5fd7\u6587\u4ef6\u662f\u5426\u5df2\u7ecf\u542f\u52a8\u6210\u529f\u4e86<\/p>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203136-6802b6a8236b8.png\" alt=\"b6651c20dfedfdcb3f36fdde8e388fae.png\" \/><\/p>\n<p>\u7136\u540e\u540e\u7aef\u7684\u5c31\u4ee5\u53ca\u542f\u52a8\u6210\u529f\u4e86&#xff0c; \u57df\u540d\u5c31\u53ef\u4ee5\u4f7f\u7528\u4e86<\/p>\n<p>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.5k\u6b21\uff0c\u70b9\u8d5e6\u6b21\uff0c\u6536\u85cf16\u6b21\u3002\u76ee\u7684\uff1ajava\u9879\u76ee\u6253\u5305\u6210jar\u5305\uff0c \u653e\u5728\u670d\u52a1\u5668\u4e0a\u53bb\u8fd0\u884c\uff0c\u5e76\u4e14\u4f7f\u7528\u57df\u540d\u4f5c\u4e3a\u540e\u7aef\u63a5\u53e3\u3002_springboot\u90e8\u7f72\u5230\u670d\u52a1\u5668<\/p>\n","protected":false},"author":2,"featured_media":21362,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,98,43],"topic":[],"class_list":["post-21377","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-spring-boot","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Springboot\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668(\u5b9d\u5854\u9762\u677f) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/21377.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Springboot\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668(\u5b9d\u5854\u9762\u677f) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.5k\u6b21\uff0c\u70b9\u8d5e6\u6b21\uff0c\u6536\u85cf16\u6b21\u3002\u76ee\u7684\uff1ajava\u9879\u76ee\u6253\u5305\u6210jar\u5305\uff0c \u653e\u5728\u670d\u52a1\u5668\u4e0a\u53bb\u8fd0\u884c\uff0c\u5e76\u4e14\u4f7f\u7528\u57df\u540d\u4f5c\u4e3a\u540e\u7aef\u63a5\u53e3\u3002_springboot\u90e8\u7f72\u5230\u670d\u52a1\u5668\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/21377.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T20:31:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203131-6802b6a37f0fa.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/21377.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/21377.html\",\"name\":\"Springboot\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668(\u5b9d\u5854\u9762\u677f) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T20:31:37+00:00\",\"dateModified\":\"2025-04-18T20:31:37+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/21377.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/21377.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/21377.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Springboot\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668(\u5b9d\u5854\u9762\u677f)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Springboot\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668(\u5b9d\u5854\u9762\u677f) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/21377.html","og_locale":"zh_CN","og_type":"article","og_title":"Springboot\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668(\u5b9d\u5854\u9762\u677f) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.5k\u6b21\uff0c\u70b9\u8d5e6\u6b21\uff0c\u6536\u85cf16\u6b21\u3002\u76ee\u7684\uff1ajava\u9879\u76ee\u6253\u5305\u6210jar\u5305\uff0c \u653e\u5728\u670d\u52a1\u5668\u4e0a\u53bb\u8fd0\u884c\uff0c\u5e76\u4e14\u4f7f\u7528\u57df\u540d\u4f5c\u4e3a\u540e\u7aef\u63a5\u53e3\u3002_springboot\u90e8\u7f72\u5230\u670d\u52a1\u5668","og_url":"https:\/\/www.wsisp.com\/helps\/21377.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T20:31:37+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203131-6802b6a37f0fa.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/21377.html","url":"https:\/\/www.wsisp.com\/helps\/21377.html","name":"Springboot\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668(\u5b9d\u5854\u9762\u677f) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T20:31:37+00:00","dateModified":"2025-04-18T20:31:37+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/21377.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/21377.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/21377.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Springboot\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668(\u5b9d\u5854\u9762\u677f)"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/21377","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=21377"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/21377\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/21362"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=21377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=21377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=21377"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=21377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}