{"id":4422,"date":"2015-06-16T17:26:04","date_gmt":"2015-06-16T09:26:04","guid":{"rendered":"https:\/\/www.hmouse.tk\/?p=4422"},"modified":"2017-06-10T13:51:44","modified_gmt":"2017-06-10T05:51:44","slug":"sonatype-nexus-%e5%ba%93%e8%a2%ab%e5%88%a0%e9%99%a4%e7%9a%84%e6%81%a2%e5%a4%8d%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.hmouse.cn\/?p=4422","title":{"rendered":"Sonatype Nexus \u4f7f\u7528\u76f8\u5173"},"content":{"rendered":"<p>Sonatype Nexus \u5e93\u88ab\u5220\u9664\u7684\u6062\u590d\u65b9\u6cd5<\/p>\n<p>\u53c2\u8003url\uff1a <a title=\"http:\/\/www.big-mouth.cn\/blog\/36.html\" href=\"http:\/\/www.big-mouth.cn\/blog\/36.html\">http:\/\/www.big-mouth.cn\/blog\/36.html<\/a><\/p>\n<p>\u53c2\u8003url\uff1a\u00a0https:\/\/my.oschina.net\/u\/178116\/blog\/519840<\/p>\n<p>\u4eca\u5929\u5728\u6574\u7406\u516c\u53f8Maven\u79c1\u670d\u7684\u65f6\u5019\uff0c\u4e0d\u5c0f\u5fc3\u628aRelease\u5e93\u5220\u6389\u4e86\u3002\u77ac\u95f4\u5192\u51fa\u51b7\u6c57\u6765\u4e86\uff01\u516c\u53f8\u6240\u6709\u7684\u79ef\u7d2f\u90fd\u6ca1\u4e86\u554a\uff0c\u8111\u5b50\u91cc\u95ea\u8fc7\u7b2c\u4e00\u4e2a\u529e\u6cd5\u5c31\u662f\u770b\u662f\u5426\u6709\u56de\u6536\u7ad9\uff0c\u6070\u597d\u5728Nexus UI\u4e2d\u770b\u5230\u4e86\u4e00\u4e2a\u53ebTrash&#8230;\u7684\u529f\u80fd\u3002\u53ef\u662f\u6211\u70b9\u51fb\u540e\u53d1\u73b0\u53ea\u6709Empty Trash\u7684\u529f\u80fd\uff0c\u8fd9\u8981\u6309\u4e0b\u53bb\u8fd8\u5f97\u4e86\u554a\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.big-mouth.cn\/attached\/20140502\/EFADDA64F0DA4D458128AA8303E8A102.png\" alt=\"\" \/><\/p>\n<p>\u6700\u540e\u5728Sonatype Nexus\u5b98\u65b9\u641c\u7d22\u5230\u4e00\u7bc7\u6587\u7ae0\uff0c\u539f\u6587\u5982\u4e0b\uff1a<\/p>\n<p><a name=\"cut\"><\/a><\/p>\n<blockquote><p>When you delete a repository from the Nexus UI, nexus will remove the repository from any groups it belongs too and move the repository contents to it&#8217;s trash folder. Sometimes you will want to restore this repository back into service.<\/p>\n<p><strong>To restore a deleted repository with id of &#8216;releases&#8217;<\/strong>:<\/p>\n<p>1. mv sonatype-work\/nexus\/trash\/releases sonatype-work\/storage so that you end up with sonatype-work\/storage\/releases<br \/>\n2. Recreate the repository with the same repository id &#8216;releases&#8217; using the repositories tab user interface.<br \/>\n3. Add the repository to any groups that it was in before.<\/p>\n<p>The act of creating the repository in the UI will force a reindex of the previous repository storage contents.<\/p><\/blockquote>\n<p>\u5e78\u597d\uff01\u627e\u5230\u4e86\u88ab\u5220\u9664\u6587\u4ef6\u6062\u590d\u7684\u529e\u6cd5\u3002\u6700\u540e\u6309\u7167\u5b98\u65b9\u6240\u63d0\u4f9b\u7684\u529e\u6cd5\u6210\u529f\u5730\u6062\u590d\u4e86\u88ab\u5220Release\u5e93\u4e0b\u6240\u6709\u7684\u6570\u636e\u3002\u64cd\u4f5c\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\u9996\u5148\u627e\u5230sonatype-work\/nexus\/trash \u4e0b\u627e\u5230\u4f60\u5220\u9664\u7684\u5e93\uff0c\u5e76\u4fdd\u5b58\u5230\u5176\u4ed6\u5730\u65b9;<br \/>\n<img decoding=\"async\" src=\"http:\/\/www.big-mouth.cn\/attached\/20140502\/32ADC83F96854E48A4F0F26C1E23E504.png\" alt=\"\" \/><\/li>\n<li>\u7136\u540e\u901a\u8fc7nexus\u63a7\u5236\u53f0\u70b9\u51fbAdd\uff0c\u9009\u62e9Hosted Repository\uff0c\u7136\u540e\u8f93\u5165\u88ab\u5220\u9664\u7684Repository\u4fe1\u606f\uff1b<br \/>\n<img decoding=\"async\" src=\"http:\/\/www.big-mouth.cn\/attached\/20140502\/C0B41000ECA24F73B853AC8BC0C1E379.png\" alt=\"\" \/><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.big-mouth.cn\/attached\/20140502\/B3F7E2273E544E8282FAD2E82EA7EEF1.png\" alt=\"\" \/><\/li>\n<li>\u628a\u521a\u624d\u4fdd\u5b58\u7684\u5e93\u6587\u4ef6copy\u5230\u6307\u5b9a\u7684sonatype-work\/nexus\/storage\/[releases]\u4e0b\u5373\u53ef;<\/li>\n<li>\u70b9\u51fb\u5217\u8868\u4e2d\u7684Public Repositories\uff0c\u7136\u540e\u5728\u4e0b\u65b9\u7684Configuration\u6807\u7b7e\u4e0b\u5c06Releases\u6dfb\u52a0\u5230Ordered Group Repositories\u4e2d;<br \/>\n<img decoding=\"async\" src=\"http:\/\/www.big-mouth.cn\/attached\/20140502\/D40A2A0731964241B6AB5E6929E98A5E.png\" alt=\"\" \/><\/li>\n<li>\u6700\u540eSave\u4fdd\u5b58\u5c31\u53ef\u4ee5\u4e86\u3002<\/li>\n<\/ol>\n<h1><strong>Nexus\u7684\u65e7\u5e93\u8fc1\u79fb<\/strong><\/h1>\n<p>\u53c2\u8003url\uff1a\u00a0http:\/\/www.cnblogs.com\/zhangqingsh\/archive\/2013\/03\/14\/2959301.html<\/p>\n<p>&nbsp;<\/p>\n<p><strong>4.\u65e7\u5e93\u8fc1\u79fb\uff08Nexus \u5230 Nexus\uff09<\/strong><\/p>\n<p>\u65e7\u5e93\u8fc1\u79fb\u5176\u5b9e\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u5c06\u65e7\u7684\u5e93\u6587\u4ef6\u62f7\u8d1d\u5230\u65b0\u5e93\u5bf9\u5e94\u4f4d\u7f6e\uff0c\u7136\u540erepair index\u5c31\u53ef\u4ee5\u4e86\u3002\u5982\uff1a<\/p>\n<p>\u5c06\u65e7\u5e93\u7684\u201c\/usr\/local\/nexus\/sonatype-work\/nexus\/storage\/releases\u201d\u6587\u4ef6\u5939\u8986\u76d6\u5230\u65b0\u5e93\u7684\u201c\/usr\/local\/nexus\/sonatype-work\/nexus\/storage\/releases\u201d\uff0c\u7136\u540e\u201crepair index\u201d\uff08<em>\u9700\u8981\u82b1\u8d39\u4e00\u70b9\u65f6\u95f4<\/em>\uff09\uff0c\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p>\u53c2\u8003\uff1a<a href=\"https:\/\/support.sonatype.com\/entries\/21602547-How-do-I-migrate-an-existing-repository-to-Nexus-\">https:\/\/support.sonatype.com\/entries\/21602547-How-do-I-migrate-an-existing-repository-to-Nexus-<\/a><\/p>\n<p><strong>4.\u65e7\u5e93\u8fc1\u79fb\uff08\u5176\u4ed6\u4ed3\u5e93\u5230 Nexus\uff09<\/strong><\/p>\n<p>\u5b98\u7f51\u6709\u8be6\u7ec6\u7684\u63cf\u8ff0\uff1a<a href=\"http:\/\/www.sonatype.com\/books\/nexus-book\/reference\/migrating.html\">http:\/\/www.sonatype.com\/books\/nexus-book\/reference\/migrating.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sonatype Nexus \u5e93\u88ab\u5220\u9664\u7684\u6062\u590d\u65b9\u6cd5<\/p>\n<p>\u53c2\u8003url\uff1a <a title=\"http:\/\/www.big-mouth.cn\/blog\/36.html\" href=\"http:\/\/www.big-mouth.cn\/blog\/36.html\">http:\/\/www.big-mouth.cn\/blog\/36.html<\/a><\/p>\n<p>\u53c2\u8003url\uff1a\u00a0https:\/\/my.oschina.net\/u\/178116\/blog\/519840<\/p>\n<p>\u4eca\u5929\u5728\u6574\u7406\u516c\u53f8Maven\u79c1\u670d\u7684\u65f6\u5019\uff0c\u4e0d\u5c0f\u5fc3\u628aRelease\u5e93\u5220\u6389\u4e86\u3002\u77ac\u95f4\u5192\u51fa\u51b7\u6c57\u6765\u4e86\uff01\u516c\u53f8\u6240\u6709\u7684\u79ef\u7d2f\u90fd\u6ca1\u4e86\u554a\uff0c\u8111\u5b50\u91cc\u95ea\u8fc7\u7b2c\u4e00\u4e2a\u529e\u6cd5\u5c31\u662f\u770b\u662f\u5426\u6709\u56de\u6536\u7ad9\uff0c\u6070\u597d\u5728Nexus UI\u4e2d\u770b\u5230\u4e86\u4e00\u4e2a\u53ebTrash&#8230;\u7684\u529f\u80fd\u3002\u53ef\u662f\u6211\u70b9\u51fb\u540e\u53d1\u73b0\u53ea\u6709Empty Trash\u7684\u529f\u80fd\uff0c\u8fd9\u8981\u6309\u4e0b\u53bb\u8fd8\u5f97\u4e86\u554a\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.big-mouth.cn\/attached\/20140502\/EFADDA64F0DA4D458128AA8303E8A102.png\" alt=\"\" \/><\/p>\n<p>\u6700\u540e\u5728Sonatype Nexus\u5b98\u65b9\u641c\u7d22\u5230\u4e00\u7bc7\u6587\u7ae0\uff0c\u539f\u6587\u5982\u4e0b\uff1a<\/p>\n<p><a name=\"cut\"><\/a><\/p>\n<blockquote><p>When you delete a repository from the Nexus UI, nexus will remove the repository from any groups it belongs too and move the repository contents to it&#8217;s trash folder. Sometimes you will want to restore this repository back into service.<\/p>\n<p><strong>To restore a deleted repository with id of &#8216;releases&#8217;<\/strong>:<\/p>\n<p>1. mv sonatype-work\/nexus\/trash\/releases sonatype-work\/storage so that you end up with sonatype-work\/storage\/releases<br \/>\n2. Recreate the repository with the same repository id &#8216;releases&#8217; using the repositories tab user interface.<br \/>\n3. Add the repository to any groups that it was in before.<\/p>\n<p>The act of creating the repository in the UI will force a reindex of the previous repository storage contents.<\/p><\/blockquote>\n<p>\u5e78\u597d\uff01\u627e\u5230\u4e86\u88ab\u5220\u9664\u6587\u4ef6\u6062\u590d\u7684\u529e\u6cd5\u3002\u6700\u540e\u6309\u7167\u5b98\u65b9\u6240\u63d0\u4f9b\u7684\u529e\u6cd5\u6210\u529f\u5730\u6062\u590d\u4e86\u88ab\u5220Release\u5e93\u4e0b\u6240\u6709\u7684\u6570\u636e\u3002\u64cd\u4f5c\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\u9996\u5148\u627e\u5230sonatype-work\/nexus\/trash \u4e0b\u627e\u5230\u4f60\u5220\u9664\u7684\u5e93\uff0c\u5e76\u4fdd\u5b58\u5230\u5176\u4ed6\u5730\u65b9;<br \/>\n<img decoding=\"async\" src=\"http:\/\/www.big-mouth.cn\/attached\/20140502\/32ADC83F96854E48A4F0F26C1E23E504.png\" alt=\"\" \/><\/li>\n<li>\u7136\u540e\u901a\u8fc7nexus\u63a7\u5236\u53f0\u70b9\u51fbAdd\uff0c\u9009\u62e9Hosted Repository\uff0c\u7136\u540e\u8f93\u5165\u88ab\u5220\u9664\u7684Repository\u4fe1\u606f\uff1b<br \/>\n<img decoding=\"async\" src=\"http:\/\/www.big-mouth.cn\/attached\/20140502\/C0B41000ECA24F73B853AC8BC0C1E379.png\" alt=\"\" \/><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.big-mouth.cn\/attached\/20140502\/B3F7E2273E544E8282FAD2E82EA7EEF1.png\" alt=\"\" \/><\/li>\n<li>\u628a\u521a\u624d\u4fdd\u5b58\u7684\u5e93\u6587\u4ef6copy\u5230\u6307\u5b9a\u7684sonatype-work\/nexus\/storage\/[releases]\u4e0b\u5373\u53ef;<\/li>\n<li>\u70b9\u51fb\u5217\u8868\u4e2d\u7684Public Repositories\uff0c\u7136\u540e\u5728\u4e0b\u65b9\u7684Configuration\u6807\u7b7e\u4e0b\u5c06Releases\u6dfb\u52a0\u5230Ordered Group Repositories\u4e2d;<br \/>\n<img decoding=\"async\" src=\"http:\/\/www.big-mouth.cn\/attached\/20140502\/D40A2A0731964241B6AB5E6929E98A5E.png\" alt=\"\" \/><\/li>\n<li>\u6700\u540eSave\u4fdd\u5b58\u5c31\u53ef\u4ee5\u4e86\u3002<\/li>\n<\/ol>\n<h1><strong>Nexus\u7684\u65e7\u5e93\u8fc1\u79fb<\/strong><\/h1>\n<p>\u53c2\u8003url\uff1a\u00a0http:\/\/www.cnblogs.com\/zhangqingsh\/archive\/2013\/03\/14\/2959301.html<\/p>\n<p>&nbsp;<\/p>\n<p><strong>4.\u65e7\u5e93\u8fc1\u79fb\uff08Nexus \u5230 Nexus\uff09<\/strong><\/p>\n<p>\u65e7\u5e93\u8fc1\u79fb\u5176\u5b9e\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u5c06\u65e7\u7684\u5e93\u6587\u4ef6\u62f7\u8d1d\u5230\u65b0\u5e93\u5bf9\u5e94\u4f4d\u7f6e\uff0c\u7136\u540erepair index\u5c31\u53ef\u4ee5\u4e86\u3002\u5982\uff1a<\/p>\n<p>\u5c06\u65e7\u5e93\u7684\u201c\/usr\/local\/nexus\/sonatype-work\/nexus\/storage\/releases\u201d\u6587\u4ef6\u5939\u8986\u76d6\u5230\u65b0\u5e93\u7684\u201c\/usr\/local\/nexus\/sonatype-work\/nexus\/storage\/releases\u201d\uff0c\u7136\u540e\u201crepair index\u201d\uff08<em>\u9700\u8981\u82b1\u8d39\u4e00\u70b9\u65f6\u95f4<\/em>\uff09\uff0c\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p>\u53c2\u8003\uff1a<a href=\"https:\/\/support.sonatype.com\/entries\/21602547-How-do-I-migrate-an-existing-repository-to-Nexus-\">https:\/\/support.sonatype.com\/entries\/21602547-How-do-I-migrate-an-existing-repository-to-Nexus-<\/a><\/p>\n<p><strong>4.\u65e7\u5e93\u8fc1\u79fb\uff08\u5176\u4ed6\u4ed3\u5e93\u5230 Nexus\uff09<\/strong><\/p>\n<p>\u5b98\u7f51\u6709\u8be6\u7ec6\u7684\u63cf\u8ff0\uff1a<a href=\"http:\/\/www.sonatype.com\/books\/nexus-book\/reference\/migrating.html\">http:\/\/www.sonatype.com\/books\/nexus-book\/reference\/migrating.html<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[158],"class_list":["post-4422","post","type-post","status-publish","format-standard","hentry","category-5","tag-nexus","category-5-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts\/4422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4422"}],"version-history":[{"count":5,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts\/4422\/revisions"}],"predecessor-version":[{"id":4842,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts\/4422\/revisions\/4842"}],"wp:attachment":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}