{"id":731,"date":"2016-08-29T20:32:28","date_gmt":"2016-08-29T12:32:28","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=731"},"modified":"2016-08-29T21:57:45","modified_gmt":"2016-08-29T13:57:45","slug":"maven%e5%9c%a8cmd%e4%b8%8b%e5%88%9b%e5%bb%ba%e9%a1%b9%e7%9b%ae%e7%9a%84%e6%ad%a5%e9%aa%a4","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=731","title":{"rendered":"Maven\u5728cmd\u4e0b\u521b\u5efa\u9879\u76ee\u7684\u6b65\u9aa4"},"content":{"rendered":"<blockquote>\n<p>\n\t\t<strong>\u73b0\u5728\u7684\u9879\u76ee\uff0c\u57fa\u672c\u4e0a\u90fd\u5728\u4f7f\u7528maven\u4f5c\u4e3a\u9879\u76ee\u7684\u6784\u5efa\u5de5\u5177\uff0c\u56e0\u6b64\u5b66\u4e60maven\u66f4\u5bb9\u6613\u627e\u4e00\u4efd\u4f53\u9762\u7684\u5de5\u4f5c\u3002\u4eca\u5929\u5c31\u4e3a\u5927\u5bb6\u5206\u4eab\u4e00\u4e0bmaven\u7684\u7b80\u5355\u4f7f\u7528\uff01<\/strong>\n\t<\/p>\n<\/blockquote>\n<h2>\n\tMaven\u73af\u5883\u53d8\u91cf\u7684\u8bbe\u7f6e<br \/>\n<\/h2>\n<p>\n\t&nbsp;&nbsp; &nbsp;a.\u6211\u7684\u7535\u8111&mdash;&mdash;&gt;\u5c5e\u6027&mdash;&mdash;&gt;\u9ad8\u7ea7&mdash;&mdash;&gt;\u73af\u5883\u53d8\u91cf\uff0c\u70b9\u51fb&ldquo;\u7cfb\u7edf\u53d8\u91cf&rdquo;\u4e0b\u7684\u65b0\u5efa\uff0c\u8f93\u5165\uff1a\u53d8\u91cf\u540dMAVEN_HOME; \u53d8\u91cf\u503cD:\\Program Files\\apache-maven-3.3.9<br \/>\n\t&nbsp;&nbsp; &nbsp;b.\u5728\u7cfb\u7edf\u53d8\u91cf\u5217\u8868\u4e2d\u627e\u5230\u7cfb\u7edf\u53d8\u91cfpath\uff0c\u6253\u5f00\u4e4b\uff0c\u5728\u53d8\u91cf\u503c\u4e2d\u8ffd\u52a0&rdquo;;%MAVEN_HOME%\\bin;&rdquo;\uff0c\u81f3\u6b64\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u5b8c\u6bd5<br \/>\n\t&nbsp; &nbsp; c.\u68c0\u67e5\u4e00\u4e0b\u662f\u5426\u5df2\u7ecf\u5b8c\u6210\u5b89\u88c5\uff0c\u6253\u5f00dos\u7a97\u53e3\uff0c\u8f93\u5165mvn &ndash;v\uff0c\u5982\u679c\u51fa\u73b0\u4e86Maven\u76f8\u5173\u7248\u672c\u4fe1\u606f\u5219\u8868\u793amaven\u5df2\u7ecf\u5b89\u88c5\u6210\u529f\n<\/p>\n<h2>\n\t\u4f7f\u7528maven\u5728cmd\u4e0b\u65b0\u5efa\u4e00\u4e2a\u9879\u76ee<br \/>\n<\/h2>\n<p>\n\t&nbsp;&nbsp; &nbsp;a.\u6253\u5f00dos\u547d\u4ee4\u7a97\u53e3\uff0c\u5207\u6362\u5230\u5177\u4f53\u7684\u5de5\u4f5c\u7a7a\u95f4\u4e0b\uff0c\u5982\uff1aE:\\xttblog<br \/>\n\t&nbsp;&nbsp; &nbsp;b.\u8f93\u5165mvn archetype:generate -DgroupId=com.xttblog -DartifactId=study_maven -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false\u547d\u4ee4\u5e76\u56de\u8f66<br \/>\n\t&nbsp;&nbsp; &nbsp;c.\u5728\u6307\u4ee4\u6267\u884c\u5b8c\u6210\u540e\uff0c\u51fa\u73b0BUILD SUCCESS\u5219\u8868\u793a\u521b\u5efa\u9879\u76ee\u6210\u529f(\u5982\u679c\u662f\u521a\u5b89\u88c5\u4e86Maven\u7684\uff0c\u7b2c\u4e00\u6b21\u8fd0\u884c\u53ef\u80fd\u9700\u8981\u4e00\u6bb5\u65f6\u95f4\u3002\u8fd9\u662f\u56e0\u4e3aMaven\u6b63\u5728\u4ece\u7f51\u4e0a\u4e0b\u8f7d\u5927\u90e8\u5206\u6700\u8fd1\u7684artifacts (plugin jars and other files)\u5230\u4f60\u7684\u672c\u5730\u4ed3\u5e93\u3002\u53ef\u80fd\u9700\u8981\u6267\u884c\u51e0\u6b21\u8be5\u547d\u4ee4\u624d\u80fd\u6210\u529f\u3002\u8fd9\u662f\u56e0\u4e3a\u5728\u4e0b\u8f7d\u5b8c\u6210\u4e4b\u524d\uff0c\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u8fde\u63a5\u53ef\u80fd\u8d85\u65f6)<br \/>\n\t&nbsp;&nbsp; &nbsp;d.\u521b\u5efa\u5b8c\u6210\u540e\uff0c\u8f93\u5165\u6307\u4ee4tree\u56de\u8f66\uff0c\u7ed3\u679c\u5982\u4e0b\uff1a<br \/>\n\t&nbsp;&nbsp; &nbsp;E:\\xttblog&gt;tree<br \/>\n\t&nbsp;&nbsp; &nbsp;\u6587\u4ef6\u5939 PATH \u5217\u8868<br \/>\n\t&nbsp;&nbsp; &nbsp;\u5377\u5e8f\u5217\u53f7\u4e3a 0000-4823<br \/>\n\t&nbsp;&nbsp; &nbsp;E:.<br \/>\n\t&nbsp;&nbsp; &nbsp;\u2514\u2500study_maven<br \/>\n\t&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\u2514\u2500src<br \/>\n\t&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\u251c\u2500main<br \/>\n\t&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\u2502 &nbsp;\u2514\u2500java<br \/>\n\t&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\u2502 &nbsp; &nbsp; &nbsp;\u2514\u2500com<br \/>\n\t&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\u2502 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u2514\u2500xttblog<br \/>\n\t&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\u2514\u2500test<br \/>\n\t&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\u2514\u2500java<br \/>\n\t&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\u2514\u2500com<br \/>\n\t&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;\u2514\u2500xttblog<br \/>\n\t&nbsp;&nbsp; &nbsp;E:\\xttblog&gt;\n<\/p>\n<h2>\n\t\u914d\u7f6emaven\u4ed3\u5e93<br \/>\n<\/h2>\n<p>\n\t&nbsp;&nbsp; &nbsp;a.\u627e\u5230maven\u5b89\u88c5\u76ee\u5f55\u4e0b\u7684settings.xml\u6587\u4ef6\uff0c\u5982\uff1aD:\\Program Files\\apache-maven-3.3.9\\conf\\settings.xml<br \/>\n\t&nbsp;&nbsp; &nbsp;b.\u5728settings\u8282\u70b9\u5185\u914d\u7f6e&lt;localRepository&gt;D:\\Program Files\\apache-maven-3.3.9\\Repositories\\Maven&lt;\/localRepository&gt;\uff0c\u6807\u7b7e\u5185\u662f\u5177\u4f53\u7684\u8def\u5f84<br \/>\n\t&nbsp;&nbsp; &nbsp;c.\u914d\u7f6e\u5b8c\u6210\u540e\u5728DOS\u4e0b\u8f93\u5165mvn help:system\u5e76\u56de\u8f66\uff0c\u521d\u59cb\u5316\u4ed3\u5e93\uff1b\u6b64\u65f6maven\u4f1a\u4ece\u8fdc\u7a0b\u4e0b\u8f7d\u4e00\u4e9b\u6587\u4ef6\n<\/p>\n<h2>\n\tMaven\u751f\u6210Eclipse\u5de5\u7a0b\u6587\u4ef6<br \/>\n<\/h2>\n<p>\n\t&nbsp;&nbsp; &nbsp;a.\u8fdb\u5165\u5230\u9879\u76ee\u76ee\u5f55E:\\xttblog\\study_maven\u6267\u884cmvn eclipse:eclipse\u547d\u4ee4<br \/>\n\t&nbsp;&nbsp; &nbsp;b.\u6267\u884c\u5b8c\u6210\u540e\u9879\u76ee\u6587\u4ef6\u5939\u4e0b\u56de\u591a\u4e24\u4e2a\u6587\u4ef6.classpath\u548c.project\n<\/p>\n<h2>\n\tEclipse\u5b89\u88c5Maven\u63d2\u4ef6<br \/>\n<\/h2>\n<p>\n\t&nbsp;&nbsp; &nbsp;a.\u6253\u5f00Eclipse\uff0c\u9009\u62e9Help&mdash;&mdash;&gt;Install New Software<br \/>\n\t&nbsp;&nbsp; &nbsp;b.\u9009\u62e9Add\uff0c\u8f93\u5165\uff1aMaven2\uff0c\u5728URL\u4e2d\u8f93\u5165http:\/\/m2eclipse.codehaus.org\/\u70b9\u51fbOK<br \/>\n\t&nbsp;&nbsp; &nbsp;c.\u70b9\u51fbSelect All\uff0c\u5269\u4e0b\u7684\u90fd\u53ef\u4ee5\u70b9Next\uff0c\u76f4\u5230Finish\n<\/p>\n<h2>\n\tEclipse\u4e2d\u5bfc\u5165Maven\u5de5\u7a0b<br \/>\n<\/h2>\n<p>\n\t&nbsp;&nbsp; &nbsp;a.\u5728Package Explorer\u4e2d\u53f3\u952e\uff0c\u9009\u62e9Import&mdash;&mdash;&gt;Maven&mdash;&mdash;&gt;Existing Maven Projects<br \/>\n\t&nbsp;&nbsp; &nbsp;b.\u70b9\u51fbNext\uff0c\u6d4f\u89c8\u9879\u76ee\uff0c\u7136\u540eFinish\u5373\u53ef\n<\/p>\n<p>\n\t<strong>\u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3a\u535a\u4e3b\u539f\u521b\u6587\u7ae0\uff0c\u672a\u7ecf\u535a\u4e3b\u5141\u8bb8\u4e0d\u5f97\u8f6c\u8f7d\u3002<\/strong><\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=731\">Maven\u5728cmd\u4e0b\u521b\u5efa\u9879\u76ee\u7684\u6b65\u9aa4<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u73b0\u5728\u7684\u9879\u76ee\uff0c\u57fa\u672c\u4e0a\u90fd\u5728\u4f7f\u7528maven\u4f5c\u4e3a\u9879\u76ee\u7684\u6784\u5efa\u5de5\u5177\uff0c\u56e0\u6b64\u5b66\u4e60maven\u66f4\u5bb9\u6613\u627e\u4e00\u4efd\u4f53\u9762\u7684\u5de5\u4f5c\u3002\u4eca\u5929\u5c31\u4e3a\u5927\u5bb6 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[449,451,452,450],"class_list":["post-731","post","type-post","status-publish","format-standard","hentry","category-java","tag-maven"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/731","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=731"}],"version-history":[{"count":2,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/731\/revisions"}],"predecessor-version":[{"id":733,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/731\/revisions\/733"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=731"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=731"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}