{"id":151085,"date":"2020-09-01T18:07:24","date_gmt":"2020-09-01T10:07:24","guid":{"rendered":"http:\/\/4563.org\/?p=151085"},"modified":"2020-09-01T18:07:24","modified_gmt":"2020-09-01T10:07:24","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-spring-boot-%e6%9d%a5%e7%ae%a1%e7%90%86-maven-plugin-%e7%9a%84%e7%89%88%e6%9c%ac%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=151085","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 Spring Boot \u6765\u7ba1\u7406 Maven plugin \u7684\u7248\u672c\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5982\u4f55\u4f7f\u7528 Spring Boot \u6765\u7ba1\u7406 Maven plugin \u7684\u7248\u672c\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : JasonLaw <\/span>  <span><i><\/i> 29<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u5728maven &#8211; Spring Boot &#8211; parent pom when you already have a parent pom &#8211; Stack Overflow\u4e2d\uff0c\u4f7f\u7528\u4e86<\/p>\n<pre><code>&lt;dependencyManagement&gt;     &lt;dependencies&gt;         &lt;dependency&gt;             &lt;!-- Import dependency management from Spring Boot --&gt;             &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;             &lt;artifactId&gt;spring-boot-dependencies&lt;\/artifactId&gt;             &lt;version&gt;2.1.3.RELEASE&lt;\/version&gt;             &lt;type&gt;pom&lt;\/type&gt;             &lt;scope&gt;import&lt;\/scope&gt;         &lt;\/dependency&gt;     &lt;\/dependencies&gt; &lt;\/dependencyManagement&gt; <\/code><\/pre>\n<p>\u6765\u5b9e\u73b0\u201c\u5229\u7528 Spring Boot \u7ba1\u7406 dependency \u7684\u7248\u672c\u201d\u3002\u90a3\u4e48\u6709\u6ca1\u6709\u4ec0\u4e48\u65b9\u5f0f\u53ef\u4ee5\u5b9e\u73b0\u201c\u5229\u7528 Spring Boot \u7ba1\u7406 plugin \u7684\u7248\u672c\u201d\u5462\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3031915\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SoloCompany <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5e94\u8be5\u4e0d\u53ef\u4ee5<\/p>\n<p>\u9996\u5148, \u4e00\u4e2a\u65e0\u5173\u7684\u4e8b\u60c5, \u4f7f\u7528 &lt;scope&gt;import&lt;\/scope&gt; \u5bfc\u5165\u5b58\u5728\u7684\u6bd4\u8f83\u660e\u663e\u7684\u95ee\u9898\u662f, \u65e0\u6cd5\u8986\u76d6\u91cc\u9762\u5b9a\u4e49\u7684 properties, \u6bd4\u5982\u4f60\u5e0c\u671b\u6539\u53d8\u6240 import \u7684 kotlin \u7248\u672c, \u5c31\u4e0d\u5f97\u4e0d\u628a\u6240\u6709\u4f9d\u8d56\u7684 kotlin artifacts \u91cd\u65b0\u5199\u4e00\u904d<\/p>\n<p>\u800c\u5982\u679c\u76f4\u63a5\u4f7f\u7528 org.springframework.boot:spring-boot-dependencies \u4f5c\u4e3a parent (\u4e5f\u5c31\u662f\u7ee7\u627f), \u5219\u6ca1\u6709\u8fd9\u4e2a\u95ee\u9898, \u5f88\u8f7b\u677e\u7684\u5c31\u80fd\u5b9e\u73b0\u8986\u76d6<\/p>\n<p>&lt;properties&gt;<br \/>&lt;kotlin.version&gt;1.4.0&lt;\/kotlin.version&gt;<br \/>&lt;\/properties&gt;<\/p>\n<p>\u56de\u5230\u4f60\u8bf4\u7684\u95ee\u9898, scope=import \u53ea\u80fd\u5bfc\u5165 dependency management \u4e0d\u80fd\u5bfc\u5165 pluginManagement<\/p>\n<p>\u6240\u4ee5, \u6700\u7b80\u5355\u7684\u65b9\u6848\u8fd8\u662f\u4f7f\u7528 parent \u7ee7\u627f, \u800c\u4e0d\u662f scope import                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3031916\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Itach1 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             spring-boot-dependencies \u5305\u542b pluginManagement \u6765\u7ba1\u7406 plugin version                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3031917\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : JasonLaw <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @SoloCompany #1 \u6211\u5e0c\u671b\u5b83\u7684 parent \u662f\u5185\u90e8\u7684\uff0c\u800c\u4e0d\u662f Spring Boot \u7684\uff0c\u6240\u4ee5\u91c7\u7528\u4e86&lt;scope&gt;import&lt;\/scope&gt;\u8fd9\u79cd\u65b9\u5f0f\u3002\u73b0\u5728\u7684\u8bdd\uff0c\u5c31\u662f\u81ea\u5df1\u663e\u793a\u5730\u8bbe\u7f6e plugin \u7684\u7248\u672c\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3031918\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : JasonLaw <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Itach1 #2 <\/p>\n<p>https:\/\/stackoverflow.com\/questions\/21317006\/spring-boot-parent-pom-when-you-already-have-a-parent-pom&#8211;#comment44077262_21318359<\/p>\n<p>https:\/\/stackoverflow.com\/a\/47954088\/5232255                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3031919\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SoloCompany <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @JasonLaw #3 \u6211\u5df2\u7ecf\u548c\u4f60\u8ba8\u8bba\u4e86 import \u7684\u7f3a\u9677\u4e86, \u6700\u8981\u547d\u7684\u4e00\u70b9\u662f\u8986\u76d6\u4e0d\u4e86\u5c5e\u6027, \u540c\u65f6 plugin management \u65e0\u6cd5\u5bfc\u5165\u4e5f\u662f\u53e6\u4e00\u4e2a\u660e\u663e\u7684\u7f3a\u9677, \u6240\u4ee5\u57fa\u672c\u4e0a\u522b\u65e0\u9009\u62e9, \u8fd8\u662f\u7528 parent \u7ee7\u627f\u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4f7f\u7528 Spring Boot &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/151085"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=151085"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/151085\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=151085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=151085"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=151085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}