{"id":5899,"date":"2024-08-01T22:49:16","date_gmt":"2024-08-01T14:49:16","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=5899"},"modified":"2024-08-02T15:01:01","modified_gmt":"2024-08-02T07:01:01","slug":"springboot-maven%e9%a1%b9%e7%9b%aepom%e4%b8%ad%e7%9a%84dependency%e4%be%9d%e8%b5%96%e6%a0%87%e7%ad%be%e7%9a%84%e7%94%a8%e6%b3%95%e6%95%b4%e7%90%86","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/spring-boot\/springboot-maven%e9%a1%b9%e7%9b%aepom%e4%b8%ad%e7%9a%84dependency%e4%be%9d%e8%b5%96%e6%a0%87%e7%ad%be%e7%9a%84%e7%94%a8%e6%b3%95%e6%95%b4%e7%90%86\/","title":{"rendered":"SpringBoot Maven\u9879\u76eepom\u4e2d\u7684dependency\u4f9d\u8d56\u6807\u7b7e\u7684\u7528\u6cd5\u6574\u7406"},"content":{"rendered":"<div class=\"wxsyncmain\">\n<section style=\"text-align: left; margin-bottom: 32px;\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">\u5728\u9879\u76ee\u8d76\u8fdb\u5ea6\u7684\u65f6\u5019\uff0c\u53ea\u77e5\u9053\u4e00\u8def\u72c2\u5954\u5411\u524d\uff0c\u4e0d\u77e5\u9053\u3001\u4e5f\u4e0d\u80fd\u505c\u4e0b\u6765\u6b23\u8d4f\u8def\u8fb9\u7684\u98ce\u666f\u3002<\/span><\/section>\n<section style=\"text-align: left; margin-bottom: 32px;\"><span style=\"font-size: 16px; letter-spacing: 0.544px;\">\u6700<\/span><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">\u8fd1\u597d\u4e0d\u5bb9\u6613\u6709\u70b9\u65f6\u95f4\uff0c\u51c6\u5907\u4f18\u5316\u4e00\u4e0b\u4e71\u4e03\u516b\u7cdf\u7684pom\u6587\u4ef6\uff0c\u6709\u4e9b\u4f9d\u8d56\u62f7\u8d1d\u8fc7\u6765\u5c31\u7528\uff0c\u4e0d\u592a\u4e86\u89e3\u6bcf\u4e2a\u6807\u7b7e\u7684\u610f\u601d\u3002<\/span><\/section>\n<section style=\"text-align: left; margin-bottom: 32px;\"><span style=\"font-size: 16px; letter-spacing: 0.034em;\">\u6bd4\u5982\u8bf4\uff1a<\/span><\/section>\n<section style=\"text-align: left; margin-bottom: 32px;\"><span style=\"font-size: 16px;\">1\u3001\u4e0b\u9762\u8fd9\u4e2a\u4f9d\u8d56\u52a0\u4e86\u4e00\u4e2aoptional=true\u662f\u5565\u610f\u601d\uff0c\u4ec0\u4e48\u662f\u53ef\u9009\u7684\uff1f<\/span><\/section>\n<pre style=\"font-size: 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin-bottom: 20px; overflow: auto; overflow-wrap: normal; word-break: break-all; padding: 10px; border-radius: 0px; line-height: 20px; background-color: #282c34; color: #333333; letter-spacing: normal; text-align: start; border: 1px solid #d9d9d9;\"><code style=\"font-size: 12px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; display: block; overflow-x: auto; background: transparent; color: #c7254e; vertical-align: middle; text-align: left; border: initial none initial;\">&lt;<span style=\"color: #e06c75;\">dependency<\/span>&gt;\n<span style=\"color: #c7254e; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space-collapse: preserve; background-color: #282c34;\">   &lt;<\/span><span style=\"font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space-collapse: preserve; background-color: #282c34; color: #e06c75;\">groupId<\/span><span style=\"color: #c7254e; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space-collapse: preserve; background-color: #282c34;\">&gt;org.springframework.boot&lt;\/<\/span><span style=\"font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space-collapse: preserve; background-color: #282c34; color: #e06c75;\">groupId<\/span><span style=\"color: #c7254e; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space-collapse: preserve; background-color: #282c34;\">&gt;\n<\/span><span style=\"color: #c7254e; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space-collapse: preserve; background-color: #282c34;\">   &lt;<\/span><span style=\"font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space-collapse: preserve; background-color: #282c34; color: #e06c75;\">artifactId<\/span><span style=\"color: #c7254e; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space-collapse: preserve; background-color: #282c34;\">&gt;spring-boot-configuration-processor&lt;\/<\/span><span style=\"font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space-collapse: preserve; background-color: #282c34; color: #e06c75;\">artifactId<\/span><span style=\"color: #c7254e; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space-collapse: preserve; background-color: #282c34;\">&gt;\n<\/span><span style=\"color: #c7254e; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space-collapse: preserve; background-color: #282c34;\">   &lt;<\/span><span style=\"font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space-collapse: preserve; background-color: #282c34; color: #e06c75;\">optional<\/span><span style=\"color: #c7254e; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space-collapse: preserve; background-color: #282c34;\">&gt;true&lt;\/<\/span><span style=\"font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space-collapse: preserve; background-color: #282c34; color: #e06c75;\">optional<\/span><span style=\"color: #c7254e; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space-collapse: preserve; background-color: #282c34;\">&gt;\n<\/span><span style=\"color: #c7254e; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space-collapse: preserve; background-color: #282c34;\">&lt;\/<\/span><span style=\"font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space-collapse: preserve; background-color: #282c34; color: #e06c75;\">dependency<\/span><span style=\"color: #c7254e; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space-collapse: preserve; background-color: #282c34;\">&gt;<\/span><\/code><\/pre>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"12\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">2\u3001\u4e0b\u9762\u8fd9\u4e2a\u4f9d\u8d56\u52a0\u4e86\u4e00\u4e2a\u4f5c\u7528\u57dfscope=test\u662f\u5565\u610f\u601d\uff1f\u8fd8\u6709\u5176\u4ed6\u7684\u5417\uff1f<\/span><\/p>\n<pre style=\"font-size: 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin-bottom: 20px; overflow: auto; overflow-wrap: normal; word-break: break-all; padding: 10px; border-radius: 0px; line-height: 20px; background-color: #282c34; color: #333333; letter-spacing: normal; text-align: start; border: 1px solid #d9d9d9;\"><code style=\"font-size: 12px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; display: block; overflow-x: auto; background: transparent; color: #c7254e; vertical-align: middle; border: initial none initial;\">&lt;<span style=\"color: #e06c75;\">dependency<\/span>&gt;\n     &lt;<span style=\"color: #e06c75;\">groupId<\/span>&gt;org.springframework.boot&lt;\/<span style=\"color: #e06c75;\">groupId<\/span>&gt;\n     &lt;<span style=\"color: #e06c75;\">artifactId<\/span>&gt;spring-boot-starter-test&lt;\/<span style=\"color: #e06c75;\">artifactId<\/span>&gt;\n     &lt;<span style=\"color: #e06c75;\">scope<\/span>&gt;test&lt;\/<span style=\"color: #e06c75;\">scope<\/span>&gt;\n&lt;\/<span style=\"color: #e06c75;\">dependency<\/span>&gt;<\/code><\/pre>\n<p><code style=\"font-size: 12px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; display: block; overflow-x: auto; background: transparent; color: #c7254e; vertical-align: middle; border: initial none initial;\">\u00a0<\/code><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"20\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">4\u3001\u4e0b\u9762\u8fd9\u4e2a\u4f9d\u8d56\u52a0\u4e86\u4e00\u4e2a\u7c7b\u578btype=pom\u662f\u5565\u610f\u601d\uff1f\u8fd8\u6709\u5176\u4ed6\u7684\u5417\uff1f<\/span><\/p>\n<pre style=\"font-size: 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin-bottom: 20px; overflow: auto; overflow-wrap: normal; word-break: break-all; padding: 10px; border-radius: 0px; line-height: 20px; background-color: #282c34; color: #333333; letter-spacing: normal; text-align: start; border: 1px solid #d9d9d9;\"><code style=\"font-size: 12px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; display: block; overflow-x: auto; background: transparent; color: #c7254e; vertical-align: middle; border: initial none initial;\">&lt;<span style=\"color: #e06c75;\">dependency<\/span>&gt;\n     &lt;<span style=\"color: #e06c75;\">groupId<\/span>&gt;org.springframework.cloud&lt;\/<span style=\"color: #e06c75;\">groupId<\/span>&gt;\n     &lt;<span style=\"color: #e06c75;\">artifactId<\/span>&gt;spring-cloud-dependencies&lt;\/<span style=\"color: #e06c75;\">artifactId<\/span>&gt;\n     &lt;<span style=\"color: #e06c75;\">version<\/span>&gt;${spring-cloud.version}&lt;\/<span style=\"color: #e06c75;\">version<\/span>&gt;\n     &lt;<span style=\"color: #e06c75;\">type<\/span>&gt;pom&lt;\/<span style=\"color: #e06c75;\">type<\/span>&gt;\n     &lt;<span style=\"color: #e06c75;\">scope<\/span>&gt;import&lt;\/<span style=\"color: #e06c75;\">scope<\/span>&gt;\n&lt;\/<span style=\"color: #e06c75;\">dependency<\/span>&gt;<\/code><\/pre>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"30\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">\u4e00\u4e2a\u4f9d\u8d56\u7684\u6807\u7b7e\uff0c\u5c45\u7136\u6709\u90a3\u4e48\u591a\u4e0d\u4e86\u89e3\u7684\u5143\u7d20\u3002<\/span><\/p>\n<h3 style=\"text-align: left; margin-bottom: 32px;\" data-line=\"32\"><span style=\"color: #ff4c41;\"><strong><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">\u4e00\u3001&lt;dependency&gt;\u4f9d\u8d56<\/span><\/strong><\/span><\/h3>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"34\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">&lt;dependency&gt;\u5143\u7d20\u7528\u4e8e\u58f0\u660e\u9879\u76ee\u7684\u4f9d\u8d56\u5e93\u3002\u8fd9\u4e9b\u4f9d\u8d56\u5e93\u662f\u9879\u76ee\u5728\u7f16\u8bd1\u3001\u6d4b\u8bd5\u3001\u8fd0\u884c\u65f6\u6240\u9700\u8981\u7684\u3002Maven\u4f1a\u6839\u636e\u8fd9\u4e9b\u4f9d\u8d56\u4e0b\u8f7d\u76f8\u5e94\u7684JAR\u5305\uff0c\u5e76\u5c06\u5b83\u4eec\u6dfb\u52a0\u5230\u9879\u76ee\u7684\u7c7b\u8def\u5f84\u4e2d\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"36\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">&lt;dependency&gt;\u6807\u7b7e\u4e0b\u7684\u5143\u7d20\u6709\uff1a<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"38\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">1\u3001&lt;groupId&gt;\uff1a\u4f9d\u8d56\u7684\u7ec4\u7ec7\u6216\u9879\u76ee\u7ec4ID\u3002\u901a\u5e38\u4e0eartifactId\u4e00\u8d77\u552f\u4e00\u6807\u8bc6\u4e00\u4e2a\u4f9d\u8d56\u9879\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"40\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">2\u3001&lt;artifactId&gt;\uff1a\u5b9a\u4e49\u4f9d\u8d56\u9879\u7684\u552f\u4e00\u6807\u8bc6\u7b26\u3002\u901a\u5e38\u8868\u793a\u4f9d\u8d56\u9879\u7684\u540d\u79f0\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"42\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">3\u3001&lt;version&gt;\uff1a\u6307\u5b9a\u4f9d\u8d56\u9879\u7684\u7248\u672c\u53f7\u3002Maven\u4f1a\u6839\u636egroupId\u3001artifactId\u548cversion\u552f\u4e00\u786e\u5b9a\u4e00\u4e2a\u4f9d\u8d56\u9879\u7684\u5177\u4f53\u7248\u672c\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"44\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">4\u3001&lt;scope&gt;\uff1a\u4f9d\u8d56\u9879\u7684\u4f5c\u7528\u8303\u56f4<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"46\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">4.1\u3001compile\uff1a\u9ed8\u8ba4\u503c\uff0c\u9002\u7528\u4e8e\u5927\u591a\u6570\u60c5\u51b5\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"46\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">\u8868\u793a\u4f9d\u8d56\u5728\u7f16\u8bd1\u3001\u6d4b\u8bd5\u3001\u8fd0\u884c\u4e09\u4e2a\u9636\u6bb5\u90fd\u6709\u6548\uff0c\u4f1a\u88ab\u5305\u542b\u5728\u6700\u7ec8\u7684\u6253\u5305\u6587\u4ef6\u4e2d\uff08\u5982 JAR \u6216 WAR \u6587\u4ef6\uff09\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"46\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">4.2\u3001provided\uff1a\u8868\u793a\u4f9d\u8d56\u5728\u7f16\u8bd1\u548c\u6d4b\u8bd5\u9636\u6bb5\u6709\u6548\uff0c\u4f46\u5728\u6253\u5305\u9636\u6bb5\uff08\u5982 WAR \u6587\u4ef6\u751f\u6210\uff09\u7531\u76ee\u6807\u73af\u5883\uff08\u5982\u5e94\u7528\u670d\u52a1\u5668\uff09\u63d0\u4f9b\uff0c\u56e0\u6b64\u4e0d\u4f1a\u88ab\u6253\u5305\u5230\u6700\u7ec8\u7684\u90e8\u7f72\u5305\u4e2d\u3002<\/span><span style=\"font-size: 16px; letter-spacing: 0.034em;\">\u9002\u7528\u4e8e\u90a3\u4e9b\u7531\u76ee\u6807\u73af\u5883\u63d0\u4f9b\u7684\u6807\u51c6\u5e93\u6216\u5bb9\u5668\u76f8\u5173\u7684\u4f9d\u8d56\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"46\"><span style=\"font-size: 16px; letter-spacing: 0.034em;\">4.3\u3001runtime\uff1a\u8868\u793a\u4f9d\u8d56\u5728\u8fd0\u884c\u65f6\u6709\u6548\uff0c\u4f46\u4e0d\u53c2\u4e0e\u7f16\u8bd1\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"46\"><span style=\"font-size: 16px; letter-spacing: 0.034em;\">\u5728\u7f16\u8bd1\u548c\u6d4b\u8bd5\u9636\u6bb5\u53ef\u89c1\uff0c\u4f46\u4e0d\u4f1a\u88ab\u6253\u5305\uff0c\u9002\u7528\u4e8e\u8fd0\u884c\u65f6\u9700\u8981\u4f46\u4e0d\u662f\u7f16\u8bd1\u65f6\u9700\u8981\u7684\u5e93\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"46\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">4.4\u3001test\uff1a\u8868\u793a\u4f9d\u8d56\u4ec5\u5728\u6d4b\u8bd5\u7f16\u8bd1\u548c\u8fd0\u884c\u6d4b\u8bd5\u65f6\u4f7f\u7528\uff0c\u4e0d\u4f1a\u88ab\u6253\u5305\u5230\u6700\u7ec8\u7684\u90e8\u7f72\u5305\u4e2d\u3002\u4e3b\u8981\u7528\u4e8e\u6d4b\u8bd5\u76f8\u5173\u7684\u5e93\u6216\u5de5\u5177\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"46\"><span style=\"font-size: 16px; letter-spacing: 0.034em;\">4.5\u3001system\uff1a\u8868\u793a\u4f9d\u8d56\u4e0e\u9879\u76ee\u65e0\u5173\uff0c\u7531\u7cfb\u7edf\u4e2d\u6307\u5b9a\u8def\u5f84\u4e0b\u7684 JAR \u6587\u4ef6\u63d0\u4f9b\u3002\u5e94\u8be5\u907f\u514d\u4f7f\u7528\uff0c\u56e0\u4e3a\u5b83\u4f1a\u5bfc\u81f4\u9879\u76ee\u7684\u53ef\u79fb\u690d\u6027\u964d\u4f4e\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"46\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">4.6\u3001import\uff1a\u9ed8\u8ba4\u4e3a false\u3002\u8be5 scope \u7528\u4e8e\u7ba1\u7406 Maven \u7684 BOM\uff08Bill of Materials\uff09\u4f9d\u8d56\u9879\uff0c\u6307\u793a\u4f9d\u8d56\u7684\u4f20\u9012\u65b9\u5f0f\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"58\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">\u5982\u679c import \u5c5e\u6027\u8bbe\u7f6e\u4e3a true\uff0c\u8868\u793a\u8fd9\u4e2a\u4f9d\u8d56\u9879\u4f1a\u88ab\u9879\u76ee\u7684\u5176\u4ed6\u6a21\u5757\u9690\u5f0f\u5730\u5bfc\u5165\u3002\u8fd9\u610f\u5473\u7740\u4e0d\u9700\u8981\u663e\u5f0f\u5730\u5728\u4f9d\u8d56\u5b83\u7684\u6a21\u5757\u7684 pom.xml \u6587\u4ef6\u4e2d\u518d\u6b21\u58f0\u660e\u8fd9\u4e2a\u4f9d\u8d56\u9879\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"58\"><span style=\"font-size: 16px; letter-spacing: 0.034em;\">\u5982\u679c import \u5c5e\u6027\u8bbe\u7f6e\u4e3a false \u6216\u8005\u672a\u8bbe\u7f6e\uff0c\u5219\u9700\u8981\u5728\u4f9d\u8d56\u5b83\u7684\u6a21\u5757\u7684 pom.xml \u6587\u4ef6\u4e2d\u663e\u5f0f\u5730\u58f0\u660e\u8fd9\u4e2a\u4f9d\u8d56\u9879\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"61\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">5\u3001optional\uff1a\u6807\u8bc6\u4f9d\u8d56\u9879\u662f\u5426\u4e3a\u53ef\u9009\u7684\u3002\u9ed8\u8ba4\u4e3afalse\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"63\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">\u5982\u679c optional \u5c5e\u6027\u8bbe\u7f6e\u4e3a true\uff0c\u8868\u793a\u8fd9\u4e2a\u4f9d\u8d56\u9879\u662f\u53ef\u9009\u7684\u3002\u8fd9\u610f\u5473\u7740\u5b83\u4e0d\u662f\u9879\u76ee\u8fd0\u884c\u6240\u5fc5\u9700\u7684\uff0c\u5982\u679c\u6ca1\u6709\u627e\u5230\u8be5\u4f9d\u8d56\u9879\u6216\u8005\u65e0\u6cd5\u6ee1\u8db3\u5b83\u7684\u6761\u4ef6\uff0cMaven \u4f1a\u7ee7\u7eed\u6784\u5efa\u9879\u76ee\u800c\u4e0d\u4f1a\u62a5\u9519\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"65\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">\u5982\u679c optional \u5c5e\u6027\u8bbe\u7f6e\u4e3a false \u6216\u8005\u672a\u8bbe\u7f6e\uff0c\u5219\u8868\u793a\u8fd9\u4e2a\u4f9d\u8d56\u9879\u662f\u5fc5\u9700\u7684\u3002Maven \u5c06\u786e\u4fdd\u5728\u6784\u5efa\u9879\u76ee\u65f6\u80fd\u591f\u89e3\u6790\u548c\u6ee1\u8db3\u8fd9\u4e2a\u4f9d\u8d56\u9879\u7684\u8981\u6c42\u3002\u5982\u679c Maven \u65e0\u6cd5\u627e\u5230\u6216\u8005\u6ee1\u8db3\u5fc5\u9700\u7684\u4f9d\u8d56\u9879\uff0c\u5c06\u4f1a\u5bfc\u81f4\u6784\u5efa\u5931\u8d25\u5e76\u663e\u793a\u76f8\u5e94\u7684\u9519\u8bef\u4fe1\u606f\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"67\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">6\u3001exclusions\uff1a\u5141\u8bb8\u6392\u9664\u4f20\u9012\u6027\u4f9d\u8d56\u3002\u53ef\u4ee5\u6307\u5b9a\u4e0d\u5e0c\u671b\u5f15\u5165\u7684\u4f20\u9012\u6027\u4f9d\u8d56\u9879\u7684groupId\u548cartifactId\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"69\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">\u5f53\u4e00\u4e2a\u9879\u76ee\u4f9d\u8d56\u4e8e\u67d0\u4e2a\u5e93\uff08\u5e93A\uff09\uff0c\u800c\u8be5\u5e93\u53c8\u4f9d\u8d56\u4e8e\u53e6\u4e00\u4e2a\u5e93\uff08\u5e93B\uff09\uff0c\u4f46\u662f\u6211\u4eec\u4e0d\u5e0c\u671b\u5f15\u5165\u5e93B\uff0c\u53ef\u4ee5\u901a\u8fc7 exclusions \u6765\u6392\u9664\u5e93B\u7684\u4f20\u9012\u6027\u4f9d\u8d56\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"71\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">7\u3001classifier\uff1a\u7528\u4e8e\u6307\u5b9a\u4f9d\u8d56\u9879\u7684\u9644\u52a0\u5206\u7c7b\u5668\u3002\u901a\u5e38\u7528\u4e8e\u6307\u5b9a\u4f9d\u8d56\u9879\u7684\u67d0\u4e2a\u7279\u5b9a\u7248\u672c\u6216\u6784\u5efa\u7c7b\u578b\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"71\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">7.1\u3001sources: \u6e90\u4ee3\u7801\u5305\u30027.2\u3001tests: \u6d4b\u8bd5\u76f8\u5173\u7684\u4f9d\u8d56\u9879\u30027.3\u3001javadoc: Javadoc \u6587\u6863\u5305\u30027.4\u3001executable: \u53ef\u6267\u884c\u7684\u4e8c\u8fdb\u5236\u5305\u6216\u7279\u5b9a\u914d\u7f6e\u7684\u6784\u5efa\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"77\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">8\u3001type\uff1a\u6307\u5b9a\u4f9d\u8d56\u9879\u7684\u7c7b\u578b\u3002\u9ed8\u8ba4\u4e3a jar\uff0c\u4f46\u53ef\u4ee5\u6307\u5b9a\u4e3a\u5176\u4ed6\u7c7b\u578b\uff0c\u5982 war\u3001pom \u7b49\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"77\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">8.1\u3001jar: \u9ed8\u8ba4\u7684\u6784\u5efa\u4ea7\u7269\u7c7b\u578b\uff0c\u5305\u542b\u7f16\u8bd1\u540e\u7684\u5b57\u8282\u7801\u548c\u76f8\u5173\u8d44\u6e90\u30028.2\u3001war: Web \u5e94\u7528\u7a0b\u5e8f\u7684\u5f52\u6863\u6587\u4ef6\uff0c\u901a\u5e38\u7528\u4e8e\u90e8\u7f72\u5230 Servlet \u5bb9\u5668\u4e2d\u30028.3\u3001pom: \u5f15\u5165\u5176\u4ed6 Maven \u9879\u76ee\u7684 pom.xml \u6587\u4ef6\u4f5c\u4e3a\u4f9d\u8d56\u9879\uff0c\u800c\u4e0d\u662f\u5176\u6784\u5efa\u4ea7\u7269\u30028.4\u3001sources: \u6e90\u4ee3\u7801\u5305\uff0c\u901a\u5e38\u7528\u4e8e\u5f00\u53d1\u548c\u8c03\u8bd5\u76ee\u7684\u30028.5\u3001test-jar: \u5305\u542b\u6d4b\u8bd5\u7c7b\u7684 JAR \u5305\uff0c\u7528\u4e8e\u5171\u4eab\u6d4b\u8bd5\u4ee3\u7801\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"84\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">9\u3001systemPath\uff1a\u4ec5\u5728 scope \u8bbe\u7f6e\u4e3a system \u65f6\u6709\u6548\uff0c\u6307\u5b9a\u7cfb\u7edf\u4e2d JAR \u6587\u4ef6\u7684\u8def\u5f84\u3002<\/span><\/p>\n<h3 style=\"text-align: left; margin-bottom: 32px;\" data-line=\"88\"><span style=\"color: #ff4c41;\"><strong><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">\u6700\u540e\u603b\u7ed3<\/span><\/strong><\/span><\/h3>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"90\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">\u5728\u4ecemaven\u7684\u4f9d\u8d56\u5e93\u62f7\u8d1d\u4f9d\u8d56\u7684\u65f6\u5019\uff0c\u5927\u90e8\u5206\u53ea\u4f7f\u7528\u5230\u4e86<span style=\"color: #c7254e; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space: pre-wrap; background-color: #f6f6f6;\">&lt;groupId&gt;\u3001<span style=\"color: #c7254e; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space: pre-wrap; background-color: #f6f6f6;\">&lt;artifactId&gt;\u3001<span style=\"color: #c7254e; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; letter-spacing: normal; text-align: start; white-space: pre-wrap; background-color: #f6f6f6;\">&lt;version&gt; <\/span><\/span><\/span><\/span><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">\u8fd9\u4e09\u4e2a\u6807\u7b7e\uff0c\u53ea\u6709\u4e09\u4e2a\u6807\u7b7e\u662f\u5fc5\u586b\u9879\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"90\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px;\">\u9664\u6b64\u4e4b\u5916<\/span><span style=\"font-size: 16px; letter-spacing: 0.034em;\">\u8fd8\u6709\u5f88\u591a\u5b50\u6807\u7b7e\uff0c<\/span><span style=\"letter-spacing: 0.034em; font-size: 16px;\">\u90fd\u662f\u53ef\u9009\u7684\uff0c\u4e5f\u90fd\u6709\u9ed8\u8ba4\u503c\u3002<\/span><span style=\"font-size: 16px; letter-spacing: 0.034em;\">\u867d\u7136\u5927\u90e8\u5206\u90fd\u7528\u4e0d\u5230\uff0c\u4f46\u662f\u5728\u6709\u7a7a\u7684\u65f6\u5019\u8fd8\u662f\u6709\u5fc5\u8981\u4e86\u89e3\u4e00\u4e0b\u3002<\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"90\"><span style=\"font-size: 16px; letter-spacing: 0.034em;\">\u4e86\u89e3\u4e86\u6bcf\u4e2a\u5b50\u6807\u7b7e\u7684\u542b\u4e49\uff0c\u5728\u6574\u7406pom\u6587\u4ef6\u65f6\u76f8\u4fe1\u4f1a\u987a\u5229\u5f88\u591a\u3002<\/span><\/p>\n<section style=\"text-align: left; margin-bottom: 0px;\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px; color: #b2b2b2;\">\u66f4\u591a\u5185\u5bb9\u53c2\u8003\u5b98\u65b9\u6587\u4ef6\u6587\u6863\uff1a<\/span><\/section>\n<p style=\"text-align: left; margin-bottom: 32px;\" data-line=\"94\"><span style=\"text-align: left; letter-spacing: 0.034em; font-size: 16px; color: #b2b2b2;\">https:\/\/maven.apache.org\/guides\/introduction\/introduction-to-the-pom.html<\/span><\/p>\n<p style=\"display: none;\">\n<blockquote><p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7: \u7a0b\u5c31\u4eba\u751f<\/p><\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u5728\u9879\u76ee\u8d76\u8fdb\u5ea6\u7684\u65f6\u5019\uff0c\u53ea\u77e5\u9053\u4e00\u8def\u72c2\u5954\u5411\u524d\uff0c\u4e0d\u77e5\u9053\u3001\u4e5f\u4e0d\u80fd\u505c\u4e0b\u6765\u6b23\u8d4f\u8def\u8fb9\u7684\u98ce\u666f\u3002 \u6700\u8fd1\u597d\u4e0d\u5bb9\u6613\u6709\u70b9\u65f6\u95f4\uff0c\u51c6\u5907\u4f18\u5316\u4e00\u4e0b\u4e71\u4e03\u516b\u7cdf\u7684pom\u6587 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":5889,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[7],"tags":[],"class_list":["post-5899","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring-boot"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223011927-150x150.jpeg","content_first_image":null,"post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223011927-300x128.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223011927.jpeg","post_frist_image":null,"post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223011927-300x128.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223011927.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801223011927.jpeg","post_all_images":[],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Spring Boot","post_date":"2024-08-01","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":1371,"next_post_id":5956,"next_post_title":"\u4f7f\u7528 Spring Boot + SSE \u5b9e\u73b0\u5b9e\u65f6\u6d88\u606f\u63a8\u9001\u529f\u80fd","previous_post_id":5605,"previous_post_title":"Spring Boot\u96c6\u6210jsoup\u5b9e\u73b0html\u89e3\u6790","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/5899","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=5899"}],"version-history":[{"count":2,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/5899\/revisions"}],"predecessor-version":[{"id":6389,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/5899\/revisions\/6389"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/5889"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=5899"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=5899"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=5899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}