{"id":1437,"date":"2023-03-25T11:01:57","date_gmt":"2023-03-25T03:01:57","guid":{"rendered":""},"modified":"2023-03-25T11:01:57","modified_gmt":"2023-03-25T03:01:57","slug":"Maven \u4ed3\u5e93","status":"publish","type":"post","link":"https:\/\/bianchenghao6.com\/1437.html","title":{"rendered":"Maven \u4ed3\u5e93"},"content":{"rendered":"


\n <\/head>
\n <\/p>\n

\n

Maven \u4ed3\u5e93<\/h1>\n<\/p><\/div>\n
\n maven\u4ed3\u5e93<\/b>\u662f\u5e26\u6709pom.xml\u6587\u4ef6\u7684\u6253\u5305JAR\u6587\u4ef6\u7684\u76ee\u5f55\u3002 Maven\u5728\u4ed3\u5e93\u4e2d\u641c\u7d22\u4f9d\u8d56\u9879\u3002 Maven\u4ed3\u5e93\u67093\u79cd\u7c7b\u578b:\n <\/div>\n
\n Maven\u6309\u4ee5\u4e0b\u987a\u5e8f\u641c\u7d22\u4f9d\u8d56\u9879:\n <\/div>\n
\n \u672c\u5730\u4ed3\u5e93<\/b>\uff0c\u7136\u540e\u662f
\n \u4e2d\u592e\u4ed3\u5e93<\/b>\uff0c\u7136\u540e\u662f
\n \u8fdc\u7a0b\u4ed3\u5e93<\/b>\u3002\n <\/div>\n

Maven \u4ed3\u5e93_https:\/\/bianchenghao6.com_\u3010Maven \u6559\u7a0b\u3011_\u7b2c1\u5f20 <\/p>\n

\n \u5982\u679c\u5728\u8fd9\u4e9b\u4ed3\u5e93\u4e2d\u672a\u627e\u5230\u4f9d\u8d56\u9879\uff0c\u5219maven\u4f1a\u505c\u6b62\u5904\u7406\u5e76\u5f15\u53d1\u9519\u8bef\n <\/div>\n
\n

<\/span> <\/p>\n

1\u3001Maven\u672c\u5730\u4ed3\u5e93<\/h2>\n
\n Maven
\n \u672c\u5730\u4ed3\u5e93<\/b>\u4f4d\u4e8e\u60a8\u7684\u672c\u5730\u7cfb\u7edf\u3002\u5b83\u662f\u5728\u60a8\u8fd0\u884c\u4efb\u4f55maven\u547d\u4ee4\u65f6\u7531maven\u521b\u5efa\u7684\u3002\n <\/div>\n
\n \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cmaven\u672c\u5730\u4ed3\u5e93\u4e3a\uff05USER_HOME\uff05\/\u3002m2\u76ee\u5f55\u3002\u4f8b\u5982:
\n C:\\Users\\SSS IT\\.m2 <\/b>\u3002\n <\/div>\n

Maven \u4ed3\u5e93_https:\/\/bianchenghao6.com_\u3010Maven \u6559\u7a0b\u3011_\u7b2c2\u5f20 <\/p>\n

\u66f4\u65b0\u672c\u5730\u4ed3\u5e93\u7684\u4f4d\u7f6e<\/h2>\n
\n \u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u66f4\u6539
\n settings.xml <\/b>\u6587\u4ef6\u6765\u66f4\u6539Maven\u672c\u5730\u4ed3\u5e93\u7684\u4f4d\u7f6e\u3002\u5b83\u4f4d\u4e8e
\n MAVEN_HOME\/conf\/settings.xml <\/b>\u4e2d\uff0c\u4f8b\u5982:
\n E:\\apache-maven-3.1.1\\conf\\settings.xml <\/b>\u3002\n <\/div>\n
\n \u8ba9\u6211\u4eec\u770b\u770bsettings.xml\u6587\u4ef6\u7684\u9ed8\u8ba4\u4ee3\u7801\u3002
\n
settings.xml\n <\/div>\n
\n
 
\r\n...\r\n<settings xmlns=\"http:\/\/maven.apache.org\/SETTINGS\/1.0.0\"<\/span> \r\n   xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"<\/span> \r\n   xsi:schemaLocation=\"http:\/\/maven.apache.org\/SETTINGS\/1.0.0 http:\/\/maven.apache.org\/xsd\/settings-1.0.0.xsd\"<\/span>>\r\n  <!-- localRepository\r\n   | The path to the local repository maven will use to store artifacts.\r\n   |\r\n   | Default: ${user.home}\/.m2\/repository\r\n  <localRepository>\/path\/to\/local\/repo<\/localRepository>\r\n  -->\r\n...\r\n<\/settings>\r\n<\/pre>\n

<\/code>\n <\/div>\n

\n \u73b0\u5728\u5c06\u8def\u5f84\u66f4\u6539\u4e3a\u672c\u5730\u4ed3\u5e93\u3002\u66f4\u6539\u672c\u5730\u4ed3\u5e93\u7684\u8def\u5f84\u540e\uff0c\u5b83\u5c06\u5982\u4e0b\u6240\u793a:
\n
settings.xml\n <\/div>\n
\n
...\r\n<settings xmlns=\"http:\/\/maven.apache.org\/SETTINGS\/1.0.0\"<\/span> \r\n   xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"<\/span> \r\n   xsi:schemaLocation=\"http:\/\/maven.apache.org\/SETTINGS\/1.0.0 http:\/\/maven.apache.org\/xsd\/settings-1.0.0.xsd\"<\/span>>\r\n   <localRepository>e:\/mavenlocalrepository<\/localRepository>\r\n  \r\n...\r\n<\/settings>\r\n<\/pre>\n

<\/code>\n <\/div>\n

\n \u60a8\u53ef\u4ee5\u770b\u5230\uff0c\u73b0\u5728\u672c\u5730\u4ed3\u5e93\u7684\u8def\u5f84\u4e3ae:\/mavenlocalrepository\u3002\n <\/div>\n
\n

<\/span> <\/p>\n

2\u3001Maven\u4e2d\u592e\u4ed3\u5e93<\/h2>\n
\n Maven
\n \u4e2d\u592e\u4ed3\u5e93<\/b>\u4f4d\u4e8eWeb\u4e0a\u3002\u5b83\u662f\u7531Apache Maven\u793e\u533a\u672c\u8eab\u521b\u5efa\u7684\u3002\n <\/div>\n
\n \u4e2d\u592e\u4ed3\u5e93\u7684\u8def\u5f84\u4e3a: http:\/\/repo1.maven.org\/maven2\/\u3002\n <\/div>\n
\n \u4e2d\u592e\u4ed3\u5e93\u5305\u542b\u8bb8\u591a\u901a\u7528\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7\u6b64URL http:\/\/search.maven.org\/#browse \u3002\n <\/div>\n
\n

<\/span> <\/p>\n

3\u3001Maven\u8fdc\u7a0b\u4ed3\u5e93<\/h2>\n
\n Maven
\n \u8fdc\u7a0b\u4ed3\u5e93<\/b>\u4f4d\u4e8eWeb\u4e0a\u3002\u4e2d\u592e\u4ed3\u5e93(\u4f8b\u5982JBoss\u5e93\u7b49)\u4e2d\u53ef\u80fd\u7f3a\u5c11\u5927\u591a\u6570\u5e93\uff0c\u56e0\u6b64\u6211\u4eec\u9700\u8981\u5728pom.xml\u6587\u4ef6\u4e2d\u5b9a\u4e49\u8fdc\u7a0b\u4ed3\u5e93\u3002\n <\/div>\n
\n \u8ba9\u6211\u4eec\u770b\u4e00\u4e0b\u5728pom.xml\u6587\u4ef6\u4e2d\u6dfb\u52a0jUnit\u5e93\u7684\u4ee3\u7801\u3002
\n
pom.xml\n <\/div>\n
\n
 
\r\n<project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\"<\/span> \r\nxmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"<\/span>\r\n  xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 \r\nhttp:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\">\r\n  <modelVersion>4.0.0<\/modelVersion>\r\n  <groupId>com.lidihuo.application1<\/groupId>\r\n  <artifactId>my-application1<\/artifactId>\r\n  <version>1.0<\/version>\r\n  <packaging>jar<\/packaging>\r\n  <name>Maven Quick Start Archetype<\/name>\r\n  <url>http:\/\/maven.apache.org<\/url>\r\n  <dependencies>\r\n    <dependency>\r\n      <groupId>junit<\/groupId>\r\n      <artifactId>junit<\/artifactId>\r\n      <version>4.8.2<\/version>\r\n      <scope>test<\/scope>\r\n    <\/dependency>\r\n  <\/dependencies>\r\n<\/project>\r\n<\/pre>\n

<\/code>\n <\/div>\n

\n \u60a8\u53ef\u4ee5\u4eceMaven\u5b98\u65b9\u7f51\u7ad9
\n mvnrepository.com <\/strong>\u4e2d\u641c\u7d22\u4efb\u4f55\u4ed3\u5e93\u3002\n <\/div>\n

<\/body>
\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"Maven \u4ed3\u5e93zh-cn","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[141],"tags":[],"class_list":["post-1437","post","type-post","status-publish","format-standard","hentry","category-mavenjc"],"_links":{"self":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/1437"}],"collection":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/comments?post=1437"}],"version-history":[{"count":0,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/1437\/revisions"}],"wp:attachment":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/media?parent=1437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/categories?post=1437"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/tags?post=1437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}