{"id":307,"date":"2018-06-15T17:33:49","date_gmt":"2018-06-15T09:33:49","guid":{"rendered":"http:\/\/www.luodonggan.com\/wordpress\/?p=307"},"modified":"2018-06-15T17:38:18","modified_gmt":"2018-06-15T09:38:18","slug":"maven%e5%ae%89%e8%a3%85%e4%b8%8e%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"http:\/\/8.152.216.154:8081\/?p=307","title":{"rendered":"Maven\u5b89\u88c5\u4e0e\u914d\u7f6e"},"content":{"rendered":"<p style=\"margin: 10px auto; padding: 0px;\">\u4e00\u3001\u9700\u8981\u51c6\u5907\u7684\u4e1c\u897f<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">1. JDK<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">2. Eclipse<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">3. Maven\u7a0b\u5e8f\u5305<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">4.intellij Idea<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">\u4e8c\u3001\u4e0b\u8f7d\u4e0e\u5b89\u88c5<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">1. \u524d\u5f80<a href=\"https:\/\/maven.apache.org\/download.cgi\" target=\"_blank\" style=\"margin: 0px; padding: 0px; text-decoration-line: none; color: rgb(0, 0, 0); border-bottom: 1px dotted rgb(51, 51, 51);\">https:\/\/maven.apache.org\/download.cgi<\/a>\u4e0b\u8f7d\u6700\u65b0\u7248\u7684Maven\u7a0b\u5e8f\uff1a<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">2. \u5c06\u6587\u4ef6\u89e3\u538b\u5230D:\\Program Files\\Apache\\maven\u76ee\u5f55\u4e0b:<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">3. \u65b0\u5efa\u73af\u5883\u53d8\u91cfMAVEN_HOME\uff0c\u8d4b\u503cD:\\Program Files\\Apache\\maven4. \u7f16\u8f91\u73af\u5883\u53d8\u91cfPath\uff0c\u8ffd\u52a0%MAVEN_HOME%\\bin\\;5. \u81f3\u6b64\uff0cmaven\u5df2\u7ecf\u5b8c\u6210\u4e86\u5b89\u88c5\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7DOS\u547d\u4ee4\u68c0\u67e5\u4e00\u4e0b\u6211\u4eec\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n<pre style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: &quot;Courier New&quot; !important;\">mvn&nbsp;-v<\/pre>\n<p style=\"margin: 10px auto; padding: 0px;\">\u4e09\u3001\u914d\u7f6eMaven\u672c\u5730\u4ed3\u5e93<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">1.&nbsp;\u5728D:\\Program Files\\Apache\\\u76ee\u5f55\u4e0b\u65b0\u5efamaven-repository\u6587\u4ef6\u5939\uff0c\u8be5\u76ee\u5f55\u7528\u4f5cmaven\u7684\u672c\u5730\u5e93\u3002<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">2. \u6253\u5f00D:\\Program Files\\Apache\\maven\\conf\\settings.xml\u6587\u4ef6\uff0c\u67e5\u627e\u4e0b\u9762\u8fd9\u884c\u4ee3\u7801\uff1a<\/p>\n<pre style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: &quot;Courier New&quot; !important;\">&lt;localRepository&gt;\/path\/to\/local\/repo&lt;\/localRepository&gt;<\/pre>\n<p style=\"margin: 10px auto; padding: 0px;\">localRepository\u8282\u70b9\u9ed8\u8ba4\u662f\u88ab\u6ce8\u91ca\u6389\u7684\uff0c\u9700\u8981\u628a\u5b83\u79fb\u5230\u6ce8\u91ca\u4e4b\u5916\uff0c\u7136\u540e\u5c06localRepository\u8282\u70b9\u7684\u503c\u6539\u4e3a\u6211\u4eec\u57283.1\u4e2d\u521b\u5efa\u7684\u76ee\u5f55D:\\Program Files\\Apache\\maven-repository\u3002<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">3.&nbsp;localRepository\u8282\u70b9\u7528\u4e8e\u914d\u7f6e\u672c\u5730\u4ed3\u5e93\uff0c\u672c\u5730\u4ed3\u5e93\u5176\u5b9e\u8d77\u5230\u4e86\u4e00\u4e2a\u7f13\u5b58\u7684\u4f5c\u7528\uff0c\u5b83\u7684\u9ed8\u8ba4\u5730\u5740\u662f C:\\Users\\\u7528\u6237\u540d.m2\u3002<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">\u5f53\u6211\u4eec\u4ecemaven\u4e2d\u83b7\u53d6jar\u5305\u7684\u65f6\u5019\uff0cmaven\u9996\u5148\u4f1a\u5728\u672c\u5730\u4ed3\u5e93\u4e2d\u67e5\u627e\uff0c\u5982\u679c\u672c\u5730\u4ed3\u5e93\u6709\u5219\u8fd4\u56de\uff1b\u5982\u679c\u6ca1\u6709\u5219\u4ece\u8fdc\u7a0b\u4ed3\u5e93\u4e2d\u83b7\u53d6\u5305\uff0c\u5e76\u5728\u672c\u5730\u5e93\u4e2d\u4fdd\u5b58\u3002<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">\u6b64\u5916\uff0c\u6211\u4eec\u5728maven\u9879\u76ee\u4e2d\u8fd0\u884cmvn install\uff0c\u9879\u76ee\u5c06\u4f1a\u81ea\u52a8\u6253\u5305\u5e76\u5b89\u88c5\u5230\u672c\u5730\u4ed3\u5e93\u4e2d\u3002<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">4. \u8fd0\u884c\u4e00\u4e0bDOS\u547d\u4ee4<\/p>\n<pre style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: &quot;Courier New&quot; !important;\">mvn&nbsp;help:system<\/pre>\n<p style=\"margin: 10px auto; padding: 0px;\">\u5982\u679c\u524d\u9762\u7684\u914d\u7f6e\u6210\u529f\uff0c\u90a3\u4e48D:\\Program Files\\Apache\\maven-repository\u4f1a\u51fa\u73b0\u4e00\u4e9b\u6587\u4ef6\u3002<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">\u56db\u3001\u914d\u7f6eEclipse\u7684Maven\u73af\u5883<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">1. Eclipse Oxygen\uff0c\u6253\u5f00Window-&gt;Preferences-&gt;Maven-&gt;Installations\uff0c\u53f3\u4fa7\u70b9\u51fbAdd\u3002<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\"><img src=\"\/ueditor\/php\/upload\/image\/20180615\/1529055452367080.png\" title=\"1529055452367080.png\" alt=\"image.png\"\/><\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">2. \u8bbe\u7f6emaven\u7684\u5b89\u88c5\u76ee\u5f55\uff0c\u7136\u540eFinish<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\"><\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">3. \u9009\u4e2d\u521a\u521a\u6dfb\u52a0\u7684maven\uff0c\u5e76Apply\u3002<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\"><img src=\"\/ueditor\/php\/upload\/image\/20180615\/1529055475171138.png\" title=\"1529055475171138.png\" alt=\"image.png\"\/><\/p>\n<p style=\"margin: 10px auto; padding: 0px;\">4. \u6253\u5f00Window-&gt;Preferences-&gt;Maven-&gt;User Settings\uff0c\u914d\u7f6e\u5982\u4e0b\u5e76Apply\uff1a<\/p>\n<p style=\"margin: 10px auto; padding: 0px;\"><img src=\"\/ueditor\/php\/upload\/image\/20180615\/1529055494778628.png\" title=\"1529055494778628.png\" alt=\"image.png\"\/><\/p>\n<p style=\"margin: 10px auto; padding: 0px;\"><\/p>\n<p>\u4e94\u3001intellij Idea\u7684maven\u914d\u7f6e<\/p>\n<p><img src=\"\/ueditor\/php\/upload\/image\/20180615\/1529055196586269.png\" title=\"1529055196586269.png\" alt=\"image.png\"\/><\/p>\n<p>\u81f3\u6b64\uff0cMaven\u7684\u5b89\u88c5\u548c\u914d\u7f6e\u5168\u90e8\u7ed3\u675f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u9700\u8981\u51c6\u5907\u7684\u4e1c\u897f 1. JDK 2. Eclipse 3. Maven\u7a0b\u5e8f\u5305 4.intellij Idea [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":249,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[13],"tags":[],"_links":{"self":[{"href":"http:\/\/8.152.216.154:8081\/index.php?rest_route=\/wp\/v2\/posts\/307"}],"collection":[{"href":"http:\/\/8.152.216.154:8081\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/8.152.216.154:8081\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/8.152.216.154:8081\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/8.152.216.154:8081\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=307"}],"version-history":[{"count":3,"href":"http:\/\/8.152.216.154:8081\/index.php?rest_route=\/wp\/v2\/posts\/307\/revisions"}],"predecessor-version":[{"id":310,"href":"http:\/\/8.152.216.154:8081\/index.php?rest_route=\/wp\/v2\/posts\/307\/revisions\/310"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/8.152.216.154:8081\/index.php?rest_route=\/wp\/v2\/media\/249"}],"wp:attachment":[{"href":"http:\/\/8.152.216.154:8081\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/8.152.216.154:8081\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=307"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/8.152.216.154:8081\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}