{"id":343,"date":"2024-03-16T21:46:12","date_gmt":"2024-03-16T13:46:12","guid":{"rendered":"http:\/\/www.esufy.com\/?p=343"},"modified":"2024-03-16T21:47:29","modified_gmt":"2024-03-16T13:47:29","slug":"%e6%89%b9%e9%87%8f%e4%b8%8a%e4%bc%a0jar%e5%88%b0nexus3-x%e7%a7%81%e6%9c%8d","status":"publish","type":"post","link":"http:\/\/www.esufy.cn\/?p=343","title":{"rendered":"\u6279\u91cf\u4e0a\u4f20jar\u5230Nexus3.x\u79c1\u670d"},"content":{"rendered":"<p>1\u3001\u5148\u5c06\u672c\u5730maven\/repository\u4ed3\u5e93\u6253\u4e00\u4e2a\u5b8c\u6574\u7684zip\u538b\u7f29\u5305<\/p>\n<p>2\u3001\u4e0a\u4f20\u5230linux\u76ee\u5f55\uff0c\u5982\uff1a\/opt<\/p>\n<p>3\u3001\u89e3\u538brepository.zip<\/p>\n<p>4\u3001\u8fdb\u5165repository\u76ee\u5f55<\/p>\n<p>5\u3001\u521b\u5efatouch mavenimport.sh\u811a\u672c\uff0c\u5199\u5165\u4ee5\u4e0b\u5185\u5bb9\uff1a<br \/>\n#!\/bin\/bash<br \/>\n# copy and run this script to the root of the repository directory containing files<br \/>\n# this script attempts to exclude uploading itself explicitly so the script name is important<br \/>\n# Get command line params<\/p>\n<p>while getopts &#8220;:r:u:p:&#8221; opt; do<br \/>\ncase $opt in<br \/>\nr) REPO_URL=&#8221;$OPTARG&#8221;<br \/>\n;;<br \/>\nu) USERNAME=&#8221;$OPTARG&#8221;<br \/>\n;;<br \/>\np) PASSWORD=&#8221;$OPTARG&#8221;<br \/>\n;;<br \/>\nesac<br \/>\ndone<\/p>\n<p>find . -type f -not -path &#8216;.\/mavenimport\\.sh*&#8217; -not -path &#8216;*\/\\.*&#8217; -not -path &#8216;*\/\\^archetype\\-catalog\\.xml*&#8217; -not -path &#8216;*\/\\^maven\\-metadata\\-local*\\.xml&#8217; -not -path &#8216;*\/\\^maven\\-metadata\\-deployment*\\.xml&#8217; | sed &#8220;s|^\\.\/||&#8221; | xargs -I &#8216;{}&#8217; curl -u &#8220;$USERNAME:$PASSWORD&#8221; -X PUT -v -T {} ${REPO_URL}\/{} ;<\/p>\n<p>6\u3001\u8f93\u5165chmod a+x mavenimport.sh\u8fdb\u884c\u53ef\u6267\u884c\u6388\u6743<\/p>\n<p>7\u3001\u6267\u884c\u5bfc\u5165\u547d\u4ee4\uff1a<br \/>\n.\/mavenimport.sh -u admin -p adminadmin -r http:\/\/maven.acb.com\/repository\/cloud-release<\/p>\n<p>8\u3001\u7b49\u5f85\u5168\u90e8\u5bfc\u5165\u5b8c\u6bd5\u540e\uff0c\u5728Nexus\u4e0a\u5237\u65b0\u5373\u53ef\u770b\u5230\u5df2\u5bfc\u5165\u7684jar<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u5148\u5c06\u672c\u5730maven\/repository\u4ed3\u5e93\u6253\u4e00\u4e2a\u5b8c\u6574\u7684zip\u538b\u7f29\u5305 2\u3001\u4e0a\u4f20\u5230linux\u76ee\u5f55\uff0c\u5982\uff1a\/op [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":346,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[29,26,24],"tags":[38,42,39,40],"_links":{"self":[{"href":"http:\/\/www.esufy.cn\/index.php?rest_route=\/wp\/v2\/posts\/343"}],"collection":[{"href":"http:\/\/www.esufy.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.esufy.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.esufy.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.esufy.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=343"}],"version-history":[{"count":1,"href":"http:\/\/www.esufy.cn\/index.php?rest_route=\/wp\/v2\/posts\/343\/revisions"}],"predecessor-version":[{"id":344,"href":"http:\/\/www.esufy.cn\/index.php?rest_route=\/wp\/v2\/posts\/343\/revisions\/344"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.esufy.cn\/index.php?rest_route=\/wp\/v2\/media\/346"}],"wp:attachment":[{"href":"http:\/\/www.esufy.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.esufy.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=343"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.esufy.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}