{"id":203778,"date":"2025-05-22T15:15:43","date_gmt":"2025-05-22T07:15:43","guid":{"rendered":"https:\/\/server.hk\/cnblog\/203778\/"},"modified":"2025-05-22T15:15:43","modified_gmt":"2025-05-22T07:15:43","slug":"maven-%e5%a4%9a%e9%a1%b9%e7%9b%ae%e6%89%93%e5%8c%85%e4%b8%ad%ef%bc%8creversion-%e5%8f%98%e9%87%8f%e6%9c%aa%e6%9b%bf%e6%8d%a2%ef%bc%8c%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/203778\/","title":{"rendered":"Maven \u591a\u9879\u76ee\u6253\u5305\u4e2d\uff0c${reversion} \u53d8\u91cf\u672a\u66ff\u6362\uff0c\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>Maven \u591a\u9879\u76ee\u6253\u5305\u4e2d\uff0c${reversion} \u53d8\u91cf\u672a\u66ff\u6362\uff0c\u5982\u4f55\u89e3\u51b3\uff1f<\/h1>\n<p>\u4e00\u5206\u8015\u8018\uff0c\u4e00\u5206\u6536\u83b7\uff01\u65e2\u7136\u6253\u5f00\u4e86\u8fd9\u7bc7\u6587\u7ae0<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aMaven \u591a\u9879\u76ee\u6253\u5305\u4e2d\uff0c${reversion} \u53d8\u91cf\u672a\u66ff\u6362\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u300b<\/span>\uff0c\u5c31\u575a\u6301\u770b\u4e0b\u53bb\u5427\uff01\u6587\u4e2d\u5185\u5bb9\u5305\u542b<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u77e5\u8bc6\u70b9&#8230;\u5e0c\u671b\u4f60\u80fd\u5728\u9605\u8bfb\u672c\u6587\u540e\uff0c\u80fd\u771f\u771f\u5b9e\u5b9e\u5b66\u5230\u77e5\u8bc6\u6216\u8005\u5e2e\u4f60\u89e3\u51b3\u5fc3\u4e2d\u7684\u7591\u60d1\uff0c\u4e5f\u6b22\u8fce\u5927\u4f6c\u6216\u8005\u65b0\u4eba\u670b\u53cb\u4eec\u591a\u7559\u8a00\u8bc4\u8bba\uff0c\u591a\u7ed9\u5efa\u8bae\uff01\u8c22\u8c22\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241123\/17323626496741c199252ab.jpg\" class=\"aligncenter\"><\/p>\n<p><strong>\u89e3\u51b3 maven \u591a\u9879\u76ee\u6253\u5305\u4e2d ${reversion} \u672a\u66ff\u6362\u95ee\u9898<\/strong><\/p>\n<p>\u5728\u4f7f\u7528 maven \u7ba1\u7406\u591a\u9879\u76ee\u65f6\uff0c\u9047\u5230\u5982\u4e0b\u6253\u5305\u9519\u8bef\uff1a<\/p>\n<pre>failed to read artifact descriptor for com.example:c2:jar:1.0.0-snapshot: failure to find com.example:packagetest:pom:${reversion} in &lt;a href=\"http:\/\/xxxx\/repository\/maven-public\/\" target=\"_blank\"&gt;http:\/\/xxxx\/repository\/maven-public\/&lt;\/a&gt; was cached in the local repository, resolution will not be reattempted until the update interval of nexus-repo has elapsed or updates are forced -&amp;gt; [help 1]<\/pre>\n<p>\u539f\u56e0\u662f\u7236\u9879\u76ee\u4e2d\u4f7f\u7528 ${reversion} \u4f5c\u4e3a\u7248\u672c\u53d8\u91cf\uff0c\u5b50\u9879\u76ee\u5728\u6253\u5305\u65f6\u65e0\u6cd5\u5728\u672c\u5730\u4ed3\u5e93\u4e2d\u627e\u5230\u5339\u914d\u7684\u7236\u9879\u76ee pom \u6587\u4ef6\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5\u662f\uff1a<\/p>\n<ul>\n<li><strong>\u5728\u7236\u9879\u76ee\u4e2d\u76f4\u63a5\u8bbe\u7f6e\u7248\u672c\u53f7<\/strong><\/li>\n<\/ul>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>&lt;project&gt;\n  &lt;groupid&gt;com.example&lt;\/groupid&gt;\n  &lt;artifactid&gt;packagetest&lt;\/artifactid&gt;\n  &lt;version&gt;1.0.0-snapshot&lt;\/version&gt;\n&lt;\/project&gt;<\/pre>\n<ul>\n<li><strong>\u4f7f\u7528 maven \u63d2\u4ef6\u6279\u91cf\u66f4\u65b0\u7248\u672c\u53f7<\/strong><\/li>\n<\/ul>\n<p>\u53ef\u4ee5\u4f7f\u7528 maven-release-plugin \u63d2\u4ef6\u6279\u91cf\u66f4\u65b0\u5b50\u9879\u76ee\u7684\u7236\u9879\u76ee\u7248\u672c\u53f7\uff1a<\/p>\n<pre>&lt;plugin&gt;\n  &lt;groupid&gt;org.apache.maven.plugins&lt;\/groupid&gt;\n  &lt;artifactid&gt;maven-release-plugin&lt;\/artifactid&gt;\n  &lt;version&gt;3.1.2&lt;\/version&gt;\n  &lt;configuration&gt;\n    &lt;developmentversion&gt;1.0.0-snapshot&lt;\/developmentversion&gt;\n  &lt;\/configuration&gt;\n&lt;\/plugin&gt;<\/pre>\n<p>maven \u5b98\u65b9\u5bf9\u4e8e relativepath \u7684\u89e3\u91ca\uff1a<\/p>\n<pre>The relative path of the parent pom.xml file within the check out. If not specified, it defaults to ..\/pom.xml. Maven looks for the parent POM first in this location on the filesystem, then the local repository, and lastly in the remote repo. relativePath allows you to select a different location, for example when your structure is flat, or deeper without an intermediate parent POM. However, the group ID, artifact ID and version are still required, and must match the file in the location given or it will revert to the repository for the POM. This feature is only for enhancing the development in a local checkout of that project. Set the value to an empty string in case you want to disable the feature and always resolve the parent POM from the repositories.\n\nDefault value is: ..\/pom.xml.<\/pre>\n<p>\u5230\u8fd9\u91cc\uff0c\u6211\u4eec\u4e5f\u5c31\u8bb2\u5b8c\u4e86\u300aMaven \u591a\u9879\u76ee\u6253\u5305\u4e2d\uff0c${reversion} \u53d8\u91cf\u672a\u66ff\u6362\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u300b\u7684\u5185\u5bb9\u4e86\u3002\u4e2a\u4eba\u8ba4\u4e3a\uff0c\u57fa\u7840\u77e5\u8bc6\u7684\u5b66\u4e60\u548c\u5de9\u56fa\uff0c\u662f\u4e3a\u4e86\u66f4\u597d\u7684\u5c06\u5176\u8fd0\u7528\u5230\u9879\u76ee\u4e2d\uff0c\u6b22\u8fce\u5173\u6ce8\u516c\u4f17\u53f7\uff0c\u5e26\u4f60\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u77e5\u8bc6\u70b9\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Maven \u591a\u9879\u76ee\u6253\u5305\u4e2d\uff0c${r&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-203778","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/203778","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=203778"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/203778\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=203778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=203778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=203778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}