
{"id":942,"date":"2016-12-19T11:39:05","date_gmt":"2016-12-19T03:39:05","guid":{"rendered":"http:\/\/www.jiandaima.com\/blog\/?p=942"},"modified":"2016-12-19T11:39:05","modified_gmt":"2016-12-19T03:39:05","slug":"maven%e5%ae%9e%e6%88%98%ef%bc%9apom-xml%e4%b8%8esettings-xml","status":"publish","type":"post","link":"http:\/\/www.jiandaima.com\/blog\/archives\/942.html","title":{"rendered":"Maven\u5b9e\u6218\uff1apom.xml\u4e0esettings.xml"},"content":{"rendered":"<p>pom.xml\u4e0esettings.xml<\/p>\n<p>pom.xml\u4e0esetting.xml\uff0c\u53ef\u4ee5\u8bf4\u662fMaven\u4e2d\u6700\u91cd\u8981\u7684\u4e24\u4e2a\u914d\u7f6e\u6587\u4ef6\uff0c\u51b3\u5b9a\u4e86Maven\u7684\u6838\u5fc3\u529f\u80fd\uff0c\u867d\u7136\u4e4b\u524d\u7684\u6587\u7ae0\u96f6\u96f6\u788e\u788e\u6709\u63d0\u5230\u8fc7pom.xml\u548csettings.xml\u91cc\u9762\u7684\u5185\u5bb9\uff0c\u4f46\u90fd\u662f\u5927\u7565\u5e26\u8fc7\uff0c\u5b66\u4e60\u4e0e\u7814\u7a76\u5730\u5e76\u4e0d\u7ec6\u81f4\uff0c\u672c\u6587\u7684\u76ee\u7684\u5c31\u662f\u8be6\u7ec6\u7814\u7a76\u4e0b\u8fd9\u4e24\u4e2aMaven\u91cd\u8981\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u4ece\u8fd9\u4e24\u4e2a\u914d\u7f6e\u6587\u4ef6\u53ef\u4ee5\u7275\u51fa\u975e\u5e38\u591a\u7684Maven\u8bdd\u9898\u3002<\/p>\n<p><a href=\"https:\/\/www.jiandaima.com\/blog\/wp-content\/uploads\/2016\/12\/20161219113822.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/images.jiandaima.com\/blog\/wp-content\/uploads\/2016\/12\/20161219113822-300x187.png\" alt=\"\" width=\"300\" height=\"187\" class=\"aligncenter size-medium wp-image-943\" \/><\/a><br \/>\nMaven\u5750\u6807<\/p>\n<p>\u9996\u5148\u8c08\u4e00\u4e0b\u4e3a\u4ec0\u4e48\u8981\u4f7f\u7528Maven\u5750\u6807\u3002<\/p>\n<p>Maven\u4e16\u754c\u62e5\u6709\u6570\u91cf\u975e\u5e38\u5de8\u5927\u7684\u6784\u4ef6\uff0c\u4e5f\u5c31\u662f\u5e73\u65f6\u4f7f\u7528\u7684\u4e00\u4e9bjar\u3001war\u7b49\u6587\u4ef6\uff0c\u5728Maven\u4e3a\u8fd9\u4e9b\u6784\u4ef6\u5f15\u5165\u5750\u6807\u6982\u5ff5\u4e4b\u524d\uff0c\u6211\u4eec\u65e0\u6cd5\u4f7f\u7528\u4efb\u4f55\u4e00\u79cd\u65b9\u5f0f\u6765\u552f\u4e00\u6807\u8bc6\u6240\u6709\u8fd9\u4e9b\u6784\u4ef6\u3002\u56e0\u6b64\uff0c\u5982\u679c\u9700\u8981\u4f7f\u7528Spring\u4f9d\u8d56\uff0c\u90a3\u4e48\u5c31\u53bbSpring\u5b98\u7f51\u5bfb\u627e\uff1b\u5982\u679c\u9700\u8981\u4f7f\u7528log4j\u4f9d\u8d56\uff0c\u90a3\u4e48\u53c8\u53bbApache\u5b98\u7f51\u5bfb\u627e\u3002\u53c8\u56e0\u4e3a\u5404\u4e2a\u7f51\u7ad9\u98ce\u683c\u8fe5\u5f02\uff0c\u5927\u91cf\u65f6\u95f4\u82b1\u8d39\u5728\u4e86\u641c\u7d22\u548c\u6d4f\u89c8\u7f51\u9875\u7684\u5de5\u4f5c\u4e0a\u3002\u6ca1\u6709\u7edf\u4e00\u89c4\u8303\u4e0e\u6cd5\u5219\uff0c\u5de5\u4f5c\u5c31\u65e0\u6cd5\u81ea\u52a8\u5316\uff0c\u91cd\u590d\u6027\u7684\u52b3\u52a8\u672c\u6765\u5c31\u5e94\u8be5\u4ea4\u7ed9\u673a\u5668\u6765\u505a\u3002<\/p>\n<p>Maven\u5b9a\u4e49\u4e86\u8fd9\u6837\u4e00\u7ec4\u89c4\u5219\uff1a\u4e16\u754c\u4e0a\u4efb\u4f55\u4e00\u4e2a\u6784\u4ef6\u90fd\u53ef\u4ee5\u4f7f\u7528Maven\u5750\u6807\u552f\u4e00\u6807\u8bc6\uff0cMaven\u5750\u6807\u5143\u7d20\u5305\u62ecgroupId\u3001artifactId\u3001version\u3001packaging\u3001classifier\uff0c\u73b0\u5728\u53ea\u8981\u6211\u4eec\u63d0\u4f9b\u6b63\u786e\u7684\u5143\u7d20\u5750\u6807\uff0cMaven\u5c31\u80fd\u627e\u5230\u5bf9\u5e94\u7684\u6784\u4ef6\u3002\u81f3\u4e8e\u53bb\u54ea\u91cc\u4e0b\u8f7d\uff0cMaven\u672c\u8eab\u5185\u7f6e\u4e86\u4e00\u4e2a\u4e2d\u592e\u4ed3\u5e93\u7684\u5730\u5740\"http:\/\/repo1.maven.org\/maven2\"\uff0c\u8be5\u4e2d\u592e\u4ed3\u5e93\u5305\u542b\u4e86\u4e16\u754c\u4e0a\u7edd\u5927\u90e8\u5206\u6d41\u884c\u7684\u5f00\u6e90\u9879\u76ee\u6784\u4ef6\uff0cMavne\u4f1a\u5728\u9700\u8981\u7684\u65f6\u5019\u53bb\u90a3\u91cc\u4e0b\u8f7d\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u914d\u7f6e\u81ea\u5df1\u7684\u4e2d\u592e\u4ed3\u5e93\u5730\u5740\uff0c\u53bb\u81ea\u5df1\u7684\u4e2d\u592e\u4ed3\u5e93\u4e0b\u8f7d\u6784\u4ef6\u3002<\/p>\n<p>\u4e3e\u4e2a\u4f8b\u5b50\uff0cSpring\u7684context\uff1a<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;dependency&gt;\r\n    &lt;groupId&gt;org.springframework&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;spring-context&lt;\/artifactId&gt;\r\n    &lt;version&gt;4.2.6.RELEASE&lt;\/version&gt;\r\n&lt;\/dependency\r\n<\/pre>\n<p>\u770b\u4e00\u4e0b\u4e0b\u5c5e\u7684\u5404\u4e2a\u5143\u7d20\uff1a<\/p>\n<p>groupId\uff1a\u5b9a\u4e49\u5f53\u524dMaven\u9879\u76ee\u96b6\u5c5e\u7684\u5b9e\u9645\u9879\u76ee\u3002\u7531\u4e8eMaven\u9879\u76ee\u548c\u5b9e\u9645\u9879\u76ee\u672a\u5fc5\u662f\u4e00\u5bf9\u4e00\u7684\u5173\u7cfb\uff0c\u6bd4\u5982SpringFramework\u8fd9\u4e2a\u5b9e\u9645\u9879\u76ee\u53ef\u80fd\u5bf9\u5e94\u7684Maven\u9879\u76ee\u6709\u5f88\u591a\uff0c\u50cfcore\u3001context\u3001expression\u7b49\u7b49\uff0c\u56e0\u6b64groupId\u4e0d\u5e94\u8be5\u5bf9\u5e94\u9879\u76ee\u96b6\u5c5e\u7684\u516c\u53f8\u6216\u7ec4\u7ec7\uff0c\u5426\u5219artifact\u5c06\u5f88\u96be\u5b9a\u4e49<br \/>\nartifactId\uff1a\u5b9a\u4e49\u5b9e\u9645\u9879\u76ee\u4e2d\u7684\u4e00\u4e2aMaven\u6a21\u5757\uff0c\u63a8\u8350\u7684\u505a\u6cd5\u662f\u4f7f\u7528\u5b9e\u9645\u9879\u76ee\u540d\u79f0\u4f5c\u4e3aartifactId\u7684\u524d\u7f00\uff0c\u8fd9\u6837\u4f1a\u5f88\u65b9\u4fbf\u53bb\u5bfb\u627e\u5b9e\u9645\u6784\u4ef6<br \/>\nversion\uff1a\u5b9a\u4e49Maven\u9879\u76ee\u5f53\u524d\u6240\u5904\u7684\u7248\u672c\uff0c\u5982\u4e0a\u9762\u7684spring-context\u5c31\u662f4.2.6\u7684\uff0cRELEASE\u8868\u793a\u6b63\u5f0f\u53d1\u884c\u7248\u672c<br \/>\npacking\uff1a\u5b9a\u4e49Maven\u9879\u76ee\u7684\u6253\u5305\u65b9\u5f0f\uff0c\u8fd9\u9879\u4e0d\u662f\u5fc5\u987b\u7684\uff0c\u6ca1\u5217\u51fa\u6765\uff0c\u4e0d\u5b9a\u4e49\u9ed8\u8ba4\u5c31\u662fjar\u7684\u6253\u5305\u65b9\u5f0f<br \/>\nclassifier\uff1a\u5e2e\u52a9\u5b9a\u4e49\u6784\u4ef6\u8f93\u51fa\u7684\u4e00\u4e9b\u9644\u5c5e\u6784\u4ef6\uff0c\u6bd4\u5982xxx-javadoc.jar\u3001xxx-sources.jar\uff0c\u9644\u5c5e\u6784\u4ef6\u4e0e\u4e3b\u6784\u4ef6\u5bf9\u5e94\uff0c\u8fd9\u9879\u662f\u4e0d\u80fd\u76f4\u63a5\u5b9a\u4e49\u7684<br \/>\nMaven\u5750\u6807\u7684\u6982\u5ff5\u5927\u81f4\u4e0a\u5c31\u662f\u8fd9\u6837\uff0c\u7406\u89e3Maven\u5750\u6807\uff0c\u662f\u7406\u89e3Maven\u5f88\u91cd\u8981\u7684\u4e00\u6b65\u3002<\/p>\n<p>\u4f20\u9012\u6027\u4f9d\u8d56<\/p>\n<p>\u4ec0\u4e48\u662f\u4f20\u9012\u6027\u4f9d\u8d56\uff0c\u4ee5Spring\u4e3e\u4e00\u4e2a\u4f8b\u5b50\u3002\u4f7f\u7528Spring\u7684\u65f6\u5019\u4f1a\u4f9d\u8d56\u4e8e\u5176\u4ed6\u5f00\u6e90\u7684\u7c7b\u5e93\uff0c\u6b64\u65f6\u6709\u4e24\u79cd\u505a\u6cd5\uff1a<\/p>\n<p>1\u3001\u4e0b\u8f7d\u4e00\u4e2a\u5f88\u5927\u7684.zip\u5305\uff0c\u91cc\u9762\u5305\u542b\u4e86\u6240\u6709Spring\u7684jar\uff0c\u4f46\u662f\u8fd9\u4e48\u505a\u5f80\u5f80\u5c31\u5f15\u5165\u4e86\u8bb8\u591a\u4e0d\u5fc5\u8981\u7684\u4f9d\u8d56<\/p>\n<p>2\u3001\u53ea\u4e0b\u8f7dspring\u76f8\u5173\u7684.zip\u5305\uff0c\u4e0d\u5305\u542b\u4f9d\u8d56\uff0c\u5b9e\u9645\u4f7f\u7528\u7684\u65f6\u5019\u6839\u636e\u51fa\u9519\u4fe1\u606f\uff0c\u52a0\u5165\u9700\u8981\u7684\u5176\u4ed6\u4f9d\u8d56<\/p>\n<p>\u663e\u7136\u8fd9\u4e24\u79cd\u505a\u6cd5\u90fd\u975e\u5e38\u9ebb\u70e6\uff0cMaven\u7684\u4f20\u9012\u6027\u4f9d\u8d56\u673a\u5236\u5f88\u597d\u5730\u89e3\u51b3\u4e86\u8fd9\u4e00\u95ee\u9898\u3002\u6253\u5f00spring-core-4.1.0.RELEASE\u7684pom.xml\uff0c\u6211\u622a\u53d6\u4e00\u6bb5\u5173\u952e\u90e8\u5206\uff1a<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;dependencies&gt;\r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;commons-codec&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;commons-codec&lt;\/artifactId&gt;\r\n      &lt;version&gt;1.9&lt;\/version&gt;\r\n      &lt;scope&gt;compile&lt;\/scope&gt;\r\n      &lt;optional&gt;true&lt;\/optional&gt;\r\n    &lt;\/dependency&gt;\r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;commons-logging&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;commons-logging&lt;\/artifactId&gt;\r\n      &lt;version&gt;1.1.3&lt;\/version&gt;\r\n      &lt;scope&gt;compile&lt;\/scope&gt;\r\n    &lt;\/dependency&gt;\r\n    ...\r\n&lt;\/dependencies&gt;\r\n<\/pre>\n<p>\u6bd4\u5982A\u9879\u76ee\u4f9d\u8d56\u4e86spring-core\uff0cspring-core\u53c8\u4f9d\u8d56\u4e86commons-codec\u548ccommons-logging\uff0c\u90a3\u4e48commons-codec\u548ccommons-logging\u5c31\u662fA\u9879\u76ee\u7684\u4e00\u4e2a\u4f20\u9012\u6027\u4f9d\u8d56\u3002\u6709\u4e86\u4f20\u9012\u6027\u4f9d\u8d56\u673a\u5236\uff0c\u5728\u4f7f\u7528spring-core\u7684\u65f6\u5019\u5c31\u4e0d\u7528\u53bb\u8003\u8651\u5b83\u4f9d\u8d56\u4e86\u4ec0\u4e48\uff0c\u4e5f\u4e0d\u7528\u62c5\u5fc3\u5f15\u5165\u591a\u4f59\u7684\u4f9d\u8d56\uff0cMaven\u4f1a\u89e3\u6790\u5404\u4e2a\u76f4\u63a5\u4f9d\u8d56\u7684POM\uff0c\u5c06\u90a3\u4e9b\u5fc5\u8981\u7684\u95f4\u63a5\u4f9d\u8d56\uff0c\u4ee5\u4f20\u9012\u6027\u4f9d\u8d56\u7684\u5f62\u5f0f\u5f15\u5165\u5230\u5f53\u524d\u7684\u9879\u76ee\u4e2d\u53bb\u3002<\/p>\n<p>\u6709\u4e86\u4f20\u9012\u6027\u4f9d\u8d56\u673a\u5236\uff0c\u4e00\u65b9\u9762\u5927\u5927\u7b80\u5316\u548c\u65b9\u4fbf\u4e86\u4f9d\u8d56\u58f0\u660e\uff0c\u53e6\u4e00\u65b9\u9762\u5728\u5927\u90e8\u5206\u60c5\u51b5\u4e0b\u6211\u4eec\u53ea\u9700\u8981\u5173\u5fc3\u9879\u76ee\u7684\u76f4\u63a5\u4f9d\u8d56\u662f\u4ec0\u4e48\u800c\u4e0d\u7528\u8003\u8651\u8fd9\u4e9b\u76f4\u63a5\u4f9d\u8d56\u4f1a\u5f15\u5165\u4ec0\u4e48\u4f20\u9012\u6027\u4f9d\u8d56\uff0c\u4e0d\u8fc7\u6709\u65f6\u5019\u4f20\u9012\u6027\u4f9d\u8d56\u4e5f\u4f1a\u6709\u4e00\u4e9b\u95ee\u9898\uff0c\u6b64\u65f6\u6211\u4eec\u5c31\u9700\u8981\u6e05\u9664\u5730\u77e5\u9053\u8be5\u4f20\u9012\u6027\u4f9d\u8d56\u662f\u4ece\u54ea\u6761\u8def\u5f84\u5f15\u5165\u7684\uff0c\u8fd9\u5c31\u53eb\u4f9d\u8d56\u8c03\u89e3\uff0c\u4f9d\u8d56\u8c03\u89e3\u4e3b\u8981\u6709\u4e24\u70b9\u539f\u5219\uff1a<\/p>\n<p>1\u3001A->B->C->X(1.0)\uff0cA->D->X(2.0)\uff0c\u6b64\u65f6\u4e24\u6761\u4f9d\u8d56\u8def\u5f84\u4e0a\u6709\u4e24\u4e2a\u7248\u672c\u7684X\uff0c\u6b64\u65f6\u9075\u5faa\u8def\u5f84\u6700\u8fd1\u8005\u4f18\u5148\uff0c\u56e0\u6b64X(2.0)\u5c06\u88ab\u89e3\u6790\u4f7f\u7528<\/p>\n<p>2\u3001A->B->Y(1.0)\uff0cA->C->Y(2.0)\uff0cY(1.0)\u548cY(2.0)\u7684\u4f9d\u8d56\u957f\u5ea6\u662f\u4e00\u6837\u7684\uff0c\u4eceMaven2.0.9\u5f00\u59cb\uff0c\u6b64\u65f6\u9075\u5faa\u7b2c\u4e00\u58f0\u660e\u8005\u4f18\u5148\uff0c\u5373\u987a\u5e8f\u6700\u9760\u524d\u7684\u90a3\u4e2a\u4f9d\u8d56\u4f18\u5148<\/p>\n<p>\u6392\u9664\u4f9d\u8d56<\/p>\n<p>\u4f20\u9012\u6027\u4f9d\u8d56\u4f1a\u7ed9\u9879\u76ee\u9690\u5f0f\u5730\u5f15\u5165\u5f88\u591a\u4f9d\u8d56\uff0c\u8fd9\u6781\u5927\u5730\u7b80\u5316\u4e86\u9879\u76ee\u4f9d\u8d56\u7684\u7ba1\u7406\uff0c\u4f46\u662f\u6709\u65f6\u5019\u8fd9\u79cd\u7279\u6027\u4e5f\u4f1a\u5e26\u6765\u95ee\u9898\u3002\u6bd4\u5982\u6709\u79cd\u60c5\u51b5\uff1a<\/p>\n<blockquote>\n<p>\u5f53\u524d\u9879\u76ee\u4f9d\u8d56A\uff0cA\u7531\u4e8e\u67d0\u4e9b\u539f\u56e0\u4f9d\u8d56\u4e86\u53e6\u5916\u4e00\u4e2a\u7c7b\u5e93\u7684SNAPSHOT\u7248\u672c\uff0c\u90a3\u4e48\u8fd9\u4e2aSNAPSHOT\u5c31\u4f1a\u6210\u4e3a\u5f53\u524d\u9879\u76ee\u7684\u4f20\u9012\u6027\u4f9d\u8d56\uff0c\u4e8cSNAPSHOT\u7684\u4e0d\u7a33\u5b9a\u6027\u5c06\u76f4\u63a5\u5f71\u54cd\u5230\u5f53\u524d\u7684\u9879\u76ee\uff0c\u6b64\u65f6\u5c31\u9700\u8981\u6392\u9664\u8be5SNAPSHOT\uff0c\u5e76\u4e14\u5728\u5f53\u524d\u9879\u76ee\u4e2d\u58f0\u660e\u8be5\u7c7b\u5e93\u7684\u67d0\u4e2a\u6b63\u5f0f\u53d1\u5e03\u7684\u7248\u672c<\/p>\n<\/blockquote>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n\r\n&lt;dependency&gt;\r\n    &lt;groupId&gt;com.alibaba.rocketmq&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;rocketmq-client&lt;\/artifactId&gt;\r\n    &lt;version&gt;3.2.7&lt;\/version&gt;\r\n    &lt;exclusions&gt;\r\n        &lt;exclusion&gt;\r\n            &lt;groupId&gt;apache-lang&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;commons-lang&lt;\/artifactId&gt;\r\n        &lt;\/exclusion&gt;\r\n    &lt;\/exclusions&gt;\r\n&lt;\/dependency&gt;\r\n\r\n<\/pre>\n<p>\u8fd9\u91cc\u6211\u5f15\u5165\u4e86rocketmq\u7684\u4f9d\u8d56\uff0c\u4f46\u662f\u6211\u4e0d\u60f3\u4f9d\u8d56rocketmq\u91cc\u9762\u7684apache-lang\uff0c\u800c\u60f3\u8981\u81ea\u5df1\u5f15\u5165\u4f9d\u8d56\uff0c\u6240\u4ee5\u6211\u5c31\u628aapache-lang\u7ed9\u6392\u9664\u4e86\u3002<\/p>\n<p>\u8fd9\u91cc\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u58f0\u660eexclusion\u7684\u65f6\u5019\u53ea\u9700\u8981groupId\u548cartifactId\u5373\u53ef\uff0c\u800c\u4e0d\u9700\u8981version\u5143\u7d20\uff0c\u8fd9\u662f\u56e0\u4e3a\u53ea\u9700\u8981groupId\u548cartifactId\u5c31\u80fd\u552f\u4e00\u5b9a\u4f4d\u4f9d\u8d56\u56fe\u4e2d\u7684\u67d0\u4e2a\u4f9d\u8d56\u3002\u6362\u53e5\u8bdd\u8bf4\uff0cMaven\u89e3\u6790\u540e\u7684\u4f9d\u8d56\u4e2d\uff0c\u4e0d\u53ef\u80fd\u51fa\u73b0groupId\u548cartifactId\u76f8\u540c\uff0c\u4f46\u662fversion\u4e0d\u540c\u7684\u4e24\u4e2a\u4f9d\u8d56\u3002<\/p>\n<p>settings.xml<\/p>\n<p>settings.xml\u91cc\u9762\u662fMaven\u7684\u57fa\u672c\u914d\u7f6e\uff0c\u5143\u7d20\u6bd4\u8f83\u591a\uff0c\u9010\u4e00\u770b\u4e00\u4e0b<\/p>\n<p>1\u3001proxy<\/p>\n<p>proxy\u8868\u793aMaven\u7684\u4ee3\u7406\uff0c\u770b\u4e00\u4e0b\u5199\u6cd5\uff1a<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;proxies&gt;\r\n    &lt;proxy&gt;\r\n      &lt;id&gt;optional&lt;\/id&gt;\r\n      &lt;active&gt;true&lt;\/active&gt;\r\n      &lt;protocol&gt;http&lt;\/protocol&gt;\r\n      &lt;username&gt;proxyuser&lt;\/username&gt;\r\n      &lt;password&gt;proxypass&lt;\/password&gt;\r\n      &lt;host&gt;proxy.host.net&lt;\/host&gt;\r\n      &lt;port&gt;80&lt;\/port&gt;\r\n      &lt;nonProxyHosts&gt;local.net|some.host.com&lt;\/nonProxyHosts&gt;\r\n    &lt;\/proxy&gt;\r\n&lt;\/proxies&gt;\r\n<\/pre>\n<p>\u9700\u8981proxy\u662f\u56e0\u4e3a\u5f88\u591a\u65f6\u5019\u4f60\u6240\u5728\u7684\u516c\u53f8\u57fa\u4e8e\u5b89\u5168\u56e0\u7d20\u8003\u8651\uff0c\u8981\u6c42\u4f60\u4f7f\u7528\u901a\u8fc7\u5b89\u5168\u8ba4\u8bc1\u7684\u4ee3\u7406\u8bbf\u95ee\u56e0\u7279\u7f51\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5c31\u9700\u8981\u4e3aMaven\u914d\u7f6eHTTP\u4ee3\u7406\uff0c\u624d\u80fd\u8ba9\u5b83\u6b63\u5e38\u8bbf\u95ee\u5916\u90e8\u4ed3\u5e93\uff0c\u4ee5\u4e0b\u8f7d\u6240\u9700\u8981\u7684\u8d44\u6e90\u3002proxies\u4e0b\u53ef\u4ee5\u914d\u7f6e\u591a\u4e2aproxy\u5143\u7d20\uff0c\u5982\u679c\u58f0\u660e\u4e86\u591a\u4e2aproxy\u5143\u7d20\uff0c\u5219\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u7b2c\u4e00\u4e2a\u88ab\u6fc0\u6d3b\u7684proxy\u4f1a\u751f\u6548\u3002active\u4e3atrue\u8868\u793a\u6fc0\u6d3b\u8be5\u4ee3\u7406\uff0cprotocol\u8868\u793a\u4f7f\u7528\u7684\u4ee3\u7406\u534f\u8bae\uff0c\u5f53\u7136\u6700\u91cd\u8981\u7684\u662f\u6307\u5b9a\u6b63\u786e\u7684\u4e3b\u673a\u540d\uff08host\uff09\u548c\u7aef\u53e3\uff08port\uff09\uff0c\u5982\u679c\u4ee3\u7406\u670d\u52a1\u5668\u9700\u8981\u8ba4\u8bc1\u5219\u914d\u7f6eusername\u548cpassword\uff0cnonProxyHost\u5143\u7d20\u8868\u793a\u6307\u5b9a\u54ea\u4e9b\u4e3b\u673a\u540d\u4e0d\u9700\u8981\u4ee3\u7406\uff0c\u53ef\u4ee5\u7528\"|\"\u5206\u9694\u591a\u4e2a\u4e3b\u673a\u540d\uff0c\u4e5f\u652f\u6301\u901a\u914d\u7b26\"*\"\u3002<\/p>\n<p>2\u3001repository<\/p>\n<p>repository\u8868\u793aMaven\u7684\u4e2d\u592e\u4ed3\u5e93\uff0c\u56e0\u4e3a\u5c3d\u7ba1\u9ed8\u8ba4\u7684\u8fdc\u7a0b\u4ed3\u5e93\u4e2d\u7684\u6784\u4ef6\u975e\u5e38\u5e9e\u5927\uff0c\u4f46\u662f\u603b\u5f52\u4f1a\u6709\u4e0d\u6ee1\u8db3\u6211\u4eec\u9700\u6c42\u7684\u65f6\u5019\uff0c\u8fd9\u65f6\u5019\u5c31\u8981\u7528\u5230\u522b\u7684\u4e2d\u592e\u4ed3\u5e93\u4e86\u3002\u770b\u4e00\u4e0b\u5199\u6cd5\uff1a<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n\r\n&lt;repository&gt;\r\n    &lt;id&gt;public&lt;\/id&gt;\r\n    &lt;name&gt;local private nexus&lt;\/name&gt;\r\n    &lt;url&gt;http:\/\/192.168.1.6:8081\/nexus\/content\/groups\/public&lt;\/url&gt;\r\n    &lt;releases&gt;\r\n        &lt;enabled&gt;true&lt;\/enabled&gt;\r\n    &lt;\/releases&gt;\r\n    &lt;snapshots&gt;\r\n        &lt;enabled&gt;false&lt;\/enabled&gt;\r\n    &lt;\/snapshots&gt;\r\n&lt;\/repository&gt;\r\n\r\n<\/pre>\n<p>\u53ef\u4ee5\u58f0\u660e\u591a\u4e2arepository\u3002id\u5fc5\u987b\u662f\u552f\u4e00\u7684\uff0c\u5c24\u5176\u6ce8\u610f\uff0cMaven\u81ea\u5e26\u7684\u4e2d\u592e\u4ed3\u5e93\u4f7f\u7528\u7684id\u4e3acentral\uff0c\u5982\u679c\u5176\u4ed6\u4ed3\u5e93\u58f0\u660e\u4e5f\u7528\u8be5id\uff0c\u5c31\u4f1a\u8986\u76d6\u4e2d\u592e\u4ed3\u5e93\u7684\u914d\u7f6e\u3002releases\u548csnapshots\u6bd4\u8f83\u91cd\u8981\uff0c\u524d\u8005\u8868\u793a\u5f00\u542f\u4ed3\u5e93\u7684\u53d1\u5e03\u7248\u672c\u4e0b\u8f7d\u652f\u6301\uff0c\u540e\u8005\u8868\u793a\u5173\u95ed\u4ed3\u5e93\u7684\u5feb\u7167\u7248\u672c\u4e0b\u8f7d\u652f\u6301\uff0c\u8fd9\u6837\u4e00\u6765\uff0cMaven\u5c31\u4f1a\u53bb\u4ed3\u5e93\u4e0b\u8f7d\u53d1\u5e03\u7248\u672c\u7684\u6784\u4ef6\u800c\u4e0d\u4f1a\u4e0b\u8f7d\u5feb\u7167\u7248\u672c\u7684\u6784\u4ef6\u4e86\u3002<\/p>\n<p>3\u3001server<\/p>\n<p>\u5927\u90e8\u5206\u8fdc\u7a0b\u4ed3\u5e93\u65e0\u987b\u8ba4\u8bc1\u5c31\u53ef\u4ee5\u8bbf\u95ee\uff0c\u4f46\u662f\u6709\u65f6\u5019\u5904\u4e8e\u5b89\u5168\u65b9\u9762\u7684\u56e0\u7d20\u8003\u8651\uff0c\u9700\u8981\u63d0\u4f9b\u8ba4\u8bc1\u4fe1\u606f\u624d\u80fd\u8bbf\u95ee\u4e00\u4e9b\u8fdc\u7a0b\u4ed3\u5e93\uff0c\u5904\u4e8e\u5b89\u5168\u8003\u8651\uff0c\u8ba4\u8bc1\u4fe1\u606f\u4e00\u822c\u53ea\u653e\u5728settings.xml\u4e2d\uff0cserver\u5c31\u662f\u8ba4\u8bc1\u5143\u7d20\u3002\u770b\u4e00\u4e0b\u914d\u7f6e\uff1a<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n\r\n&lt;server&gt;\r\n    &lt;id&gt;nexus-releases&lt;\/id&gt;\r\n    &lt;username&gt;deployment&lt;\/username&gt;\r\n    &lt;password&gt;deployment&lt;\/password&gt;\r\n&lt;\/server&gt;\r\n\r\n<\/pre>\n<p>\u8fd9\u91cc\u7684\u5173\u952e\u662fid\uff0c\u8fd9\u4e2aid\u5fc5\u987b\u4e0e\u9700\u8981\u8ba4\u8bc1\u7684repositiry\u5143\u7d20\u7684id\u5b8c\u5168\u4e00\u81f4\u624d\u884c\uff0c\u6362\u53e5\u8bdd\u8bf4\uff0c\u6b63\u5f0f\u8fd9\u4e2aid\u5c06\u8ba4\u8bc1\u4fe1\u606f\u548c\u4ed3\u5e93\u914d\u7f6e\u8054\u7cfb\u5728\u4e86\u4e00\u8d77\u3002<\/p>\n<p>4\u3001mirror<\/p>\n<p>\u5982\u679c\u4ed3\u5e93X\u53ef\u4ee5\u63d0\u4f9b\u4ed3\u5e93Y\u5b58\u50a8\u7684\u6240\u6709\u5185\u5bb9\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u8ba4\u4e3a\u4ed3\u5e93X\u662f\u4ed3\u5e93Y\u7684\u4e00\u4e2a\u955c\u50cf\uff08mirror\uff09\uff0c\u6362\u53e5\u8bdd\u8bf4\uff0c\u4efb\u4f55\u4e00\u4e2a\u53ef\u4ee5\u4eceY\u4e2d\u83b7\u53d6\u5230\u7684\u6784\u4ef6\u591f\u53ef\u4ee5\u4eceX\u4e2d\u83b7\u53d6\u5230\u3002\u4e3e\u4e2a\u4f8b\u5b50\uff0c\"http:\/\/maven.net.cn\/content\/groups\/public\/\"\u662f\u4e2d\u592e\u4ed3\u5e93\"http:\/\/repo1.maven.org\/maven2\/\"\u5728\u4e2d\u56fd\u7684\u955c\u50cf\uff0c\u7531\u4e8e\u5730\u7406\u4f4d\u7f6e\u7684\u56e0\u7d20\uff0c\u8be5\u955c\u50cf\u5f80\u5f80\u80fd\u591f\u63d0\u4f9b\u6bd4\u4e2d\u592e\u4ed3\u5e93\u66f4\u5feb\u7684\u670d\u52a1\uff0c\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u8981\u4f7f\u7528mirror\u7684\u539f\u56e0\u3002<\/p>\n<p>\u770b\u4e00\u4e0bmirror\u7684\u914d\u7f6e\uff1a<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n\r\n&lt;mirror&gt;\r\n    &lt;id&gt;nexus&lt;\/id&gt;\r\n    &lt;name&gt;internal nexus repository&lt;\/name&gt;\r\n    &lt;url&gt;http:\/\/192.168.1.6:8081\/nexus\/content\/groups\/public&lt;\/url&gt;\r\n    &lt;mirrorOf&gt;*&lt;\/mirrorOf&gt;\r\n&lt;\/mirror&gt;\r\n\r\n<\/pre>\n<p>\u8be5\u4f8b\u5b50\u4e2d\uff0cmirrof\u4e3a*\uff0c\u8868\u793a\u8be5\u914d\u7f6e\u4e3a\u6240\u6709\u4e2d\u592e\u4ed3\u5e93\u7684\u955c\u50cf\uff0c\u4efb\u4f55\u5bf9\u4e8e\u4e2d\u592e\u4ed3\u5e93\u7684\u8bf7\u6c42\u90fd\u4f1a\u8f6c\u81f3\u8be5\u955c\u50cf\u3002\u53e6\u5916\u4e09\u4e2a\u5143\u7d20id\u3001name\u3001url\u4e0e\u4e00\u822c\u4ed3\u5e93\u914d\u7f6e\u65e0\u5f02\uff0c\u8868\u793a\u8be5\u955c\u50cf\u4ed3\u5e93\u7684\u552f\u4e00\u6807\u8bc6\u7b26\u3001\u540d\u79f0\u4ee5\u53ca\u5730\u5740\u3002\u7c7b\u4f3c\u7684\uff0c\u5982\u679c\u8be5\u955c\u50cf\u9700\u8981\u8ba4\u8bc1\uff0c\u4e5f\u53ef\u4ee5\u57fa\u4e8e\u8be5id\u914d\u7f6e\u4ed3\u5e93\u8ba4\u8bc1\u3002<\/p>\n<p>================================================================================== <\/p>\n<p>\u6211\u4e0d\u80fd\u4fdd\u8bc1\u5199\u7684\u6bcf\u4e2a\u5730\u65b9\u90fd\u662f\u5bf9\u7684\uff0c\u4f46\u662f\u81f3\u5c11\u80fd\u4fdd\u8bc1\u4e0d\u590d\u5236\u3001\u4e0d\u9ecf\u8d34\uff0c\u4fdd\u8bc1\u6bcf\u4e00\u53e5\u8bdd\u3001\u6bcf\u4e00\u884c\u4ee3\u7801\u90fd\u7ecf\u8fc7\u4e86\u8ba4\u771f\u7684\u63a8\u6572\u3001\u4ed4\u7ec6\u7684\u659f\u914c\u3002\u6bcf\u4e00\u7bc7\u6587\u7ae0\u7684\u80cc\u540e\uff0c\u5e0c\u671b\u90fd\u80fd\u770b\u5230\u81ea\u5df1\u5bf9\u4e8e\u6280\u672f\u3001\u5bf9\u4e8e\u751f\u6d3b\u7684\u6001\u5ea6\u3002<\/p>\n<p>\u6211\u76f8\u4fe1\u4e54\u5e03\u65af\u8bf4\u7684\uff0c\u53ea\u6709\u90a3\u4e9b\u75af\u72c2\u5230\u8ba4\u4e3a\u81ea\u5df1\u53ef\u4ee5\u6539\u53d8\u4e16\u754c\u7684\u4eba\u624d\u80fd\u771f\u6b63\u5730\u6539\u53d8\u4e16\u754c\u3002\u9762\u5bf9\u538b\u529b\uff0c\u6211\u53ef\u4ee5\u6311\u706f\u591c\u6218\u3001\u4e0d\u7720\u4e0d\u4f11\uff1b\u9762\u5bf9\u56f0\u96be\uff0c\u6211\u613f\u610f\u8fce\u96be\u800c\u4e0a\u3001\u6c38\u4e0d\u9000\u7f29\u3002<\/p>\n<p>\u5176\u5b9e\u6211\u60f3\u8bf4\u7684\u662f\uff0c\u6211\u53ea\u662f\u4e00\u4e2a\u7a0b\u5e8f\u5458\uff0c\u8fd9\u5c31\u662f\u6211\u73b0\u5728\u7eaf\u7cb9\u4eba\u751f\u7684\u5168\u90e8\u3002<\/p>\n<p>==================================================================================<\/p>\n<p>\u3002\u3002<\/p>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>pom.xml\u4e0esetting.xml\uff0c\u53ef\u4ee5\u8bf4\u662fMaven\u4e2d\u6700\u91cd\u8981\u7684\u4e24\u4e2a\u914d\u7f6e\u6587\u4ef6\uff0c\u51b3\u5b9a\u4e86Maven\u7684\u6838\u5fc3\u529f\u80fd\uff0c\u867d\u7136\u4e4b\u524d\u7684\u6587\u7ae0\u96f6\u96f6\u788e\u788e\u6709\u63d0\u5230\u8fc7pom.xml\u548csettings.xml\u91cc\u9762\u7684\u5185\u5bb9\uff0c\u4f46\u90fd\u662f\u5927\u7565\u5e26\u8fc7\uff0c\u5b66\u4e60\u4e0e\u7814\u7a76\u5730\u5e76\u4e0d\u7ec6\u81f4\uff0c\u672c\u6587\u7684\u76ee\u7684\u5c31\u662f\u8be6\u7ec6\u7814\u7a76\u4e0b\u8fd9\u4e24\u4e2aMaven\u91cd\u8981\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u4ece\u8fd9\u4e24\u4e2a\u914d\u7f6e\u6587\u4ef6\u53ef\u4ee5\u7275\u51fa\u975e\u5e38\u591a\u7684Maven\u8bdd\u9898\u3002<\/p>\n","protected":false},"author":1,"featured_media":943,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[313,312,314],"class_list":{"0":"post-942","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-uncategorized","8":"tag-maven","10":"tag-pom-xmlsetting-xml"},"post_thumbnail_image":"http:\/\/images.jiandaima.com\/blog\/wp-content\/uploads\/2016\/12\/20161219113822.png?imageView2\/1\/w\/300\/h\/300#","content_first_image":"http:\/\/images.jiandaima.com\/blog\/wp-content\/uploads\/2016\/12\/20161219113822.png","post_medium_image_300":"http:\/\/images.jiandaima.com\/blog\/wp-content\/uploads\/2016\/12\/20161219113822.png","post_thumbnail_image_624":"http:\/\/images.jiandaima.com\/blog\/wp-content\/uploads\/2016\/12\/20161219113822.png","post_frist_image":"http:\/\/images.jiandaima.com\/blog\/wp-content\/uploads\/2016\/12\/20161219113822.png","post_medium_image":"http:\/\/images.jiandaima.com\/blog\/wp-content\/uploads\/2016\/12\/20161219113822.png","post_large_image":"http:\/\/images.jiandaima.com\/blog\/wp-content\/uploads\/2016\/12\/20161219113822.png","post_full_image":"http:\/\/images.jiandaima.com\/blog\/wp-content\/uploads\/2016\/12\/20161219113822.png","post_all_images":[{"imagesurl":"http:\/\/images.jiandaima.com\/blog\/wp-content\/uploads\/2016\/12\/20161219113822-300x187.png","id":"image0"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":5,"total_comments":0,"category_name":"\u6e90\u7801\u5206\u4eab\u516c\u544a","post_date":"2016-12-19","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"http:\/\/images.jiandaima.com\/blog\/wp-content\/uploads\/2020\/02\/img_5e44112722964.png","avatarurls":[],"related_posts":[],"pageviews":546,"next_post_id":953,"next_post_title":"\u5f20\u5c0f\u9f99\u9996\u6b21\u5168\u9762\u9610\u8ff0\u5c0f\u7a0b\u5e8f\uff0c\u5b9a\u68631\u67089\u65e5\u4e0a\u7ebf\uff08\u5185\u9644\u6f14\u8bb2\u5168\u6587\uff09,demo\u6e90\u7801\u4e0b\u8f7d","previous_post_id":872,"previous_post_title":"Android \u6c89\u6d78\u5f0f\u72b6\u6001\u680f\u53ca\u60ac\u6d6e\u6548\u679c,\u6e90\u7801\u4e0b\u8f7d\u3002","_links":{"self":[{"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/posts\/942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/comments?post=942"}],"version-history":[{"count":0,"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/posts\/942\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/media\/943"}],"wp:attachment":[{"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/media?parent=942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/categories?post=942"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.jiandaima.com\/blog\/wp-json\/wp\/v2\/tags?post=942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}