{"id":185,"date":"2009-07-05T14:03:57","date_gmt":"2009-07-05T06:03:57","guid":{"rendered":"http:\/\/leegorous.net\/blog\/?p=185"},"modified":"2012-03-03T20:34:34","modified_gmt":"2012-03-03T12:34:34","slug":"when-maven-internal-archetype-catalog-did-notwell-behaved","status":"publish","type":"post","link":"http:\/\/leegorous.net\/blog\/2009\/07\/05\/when-maven-internal-archetype-catalog-did-notwell-behaved\/","title":{"rendered":"\u5f53maven internal archetype catalog\u4e0d\u542c\u4f7f\u7684\u65f6\u5019"},"content":{"rendered":"<p>\u6211\u7684\u76ee\u7684\u5c31\u662f\u8981\u7528archetype\u6765\u521b\u5efa\u4e00\u4e2astruts2\u7684blank\u9879\u76ee\uff0cstruts2\u5b98\u7f51\u4e0a\u5199\u7684\u67092.1.6\u7248\u672c<\/p>\n<p>\u53ef\u662f\u6211\u7684archetype\u5217\u8868\u91cc\u9762\u53ea\u6709\u4e00\u4e2a\u4e0d\u5b58\u5728\u76842.0.9-SNAPSHOT\u7248\u672c\uff0c<a href=\"http:\/\/people.apache.org\/repo\/m2-snapshot-repository\/\" target=\"_blank\">http:\/\/people.apache.org\/repo\/m2-snapshot-repository\/<\/a>\u76ee\u524d\u67092.0.11-SNAPSHOT\u548c2.0.14-SNAPSHOT\uff0c\u8fd9\u600e\u4e48\u529e\u5462\uff1f<br \/>\n\u6700\u539f\u59cb\u7684\u60f3\u6cd5\u5c31\u662f\u628a\u5305\u542b2.1.6\u7684repo\u5730\u5740\uff08<a href=\"http:\/\/www.lenart.org.pl\/maven\/\" target=\"_blank\" >http:\/\/www.lenart.org.pl\/maven\/<\/a>\uff09\u52a0\u5165\u5230settings.xml\u91cc\u9762\uff0c\u7ed3\u679c\u6ca1\u53cd\u5e94\u3002<br \/>\n\u624b\u52a8\u5b89\u88c5\uff0c\u540c\u6837\u6ca1\u53cd\u5e94\u3002<br \/>\n\u8fd9\u4e2a\u65f6\u5019\u53ef\u4ee5\u60f3\u8c61\u5230maven\u6709\u4e00\u4e2a\u5217\u8868\u4e00\u6837\u7684\u4e1c\u897f\u6765\u7ef4\u62a4\u8fd9\u4e9barchetype\uff0c\u5f88\u5feb\u7f51\u4e0a\u7684\u8d44\u6599\u8bc1\u5b9e\u4e86\u6211\u7684\u60f3\u6cd5\uff0c\u4e8e\u662f\u6211\u5c1d\u8bd5\u624b\u52a8\u7684\u66f4\u65b0catalog<\/p>\n<pre name=\"code\" class=\"brush: bash\">\r\nmvn archetype:crawl\r\n<\/pre>\n<p>maven\u54c4\u54c4\u7684\u626b\u63cf\u5b8c\u4e00\u904d\u4e4b\u540e\uff0c\u6ca1\u60f3\u5230\u5b83\u4f9d\u7136\u7f20\u7ed5\u57282.0.9-SNAPSHOT\u4e0a\u9762\u3002<\/p>\n<p>\u5fc3\u90fd\u51c9\u4e86\uff0c\u7a81\u7136\u4e4b\u95f4maven\u5728\u6211\u5185\u5fc3\u7684\u8bc4\u4ef7\u76f4\u63a5\u8df3\u6c34\uff0cmaven\u7684\u8fd9\u4e2a\u63d2\u4ef6\u597d\u50bb\u3002<br \/>\n\u5176\u5b9e\u8fd9\u4e2a\u65f6\u5019\u5e94\u8be5\u6362\u4e2aarchetype\u5c31\u597d\uff0cappfuse\u6709\u7684\uff0c\u4e0d\u8fc7\u5c31\u662f\u4e0d\u559c\u6b22\u5b83\u521b\u5efa\u51fa\u6765\u7684\u4e1c\u897f\u592a\u6742\u4e71\u3002\u4e0d\u6362archetype\uff0c\u5e94\u8be5\u53ef\u4ee5\u6362\u4e2aarchetype catalog\u5427\uff0c\u4e8e\u662f\u76ee\u5149\u805a\u96c6\u5728<a href=\"http:\/\/maven.apache.org\/plugins\/maven-archetype-plugin\/examples\/generate-alternative-catalog.html\" target=\"_blank\"  >http:\/\/maven.apache.org\/plugins\/maven-archetype-plugin\/examples\/generate-alternative-catalog.html<\/a><\/p>\n<pre name=\"code\" class=\"brush: bash\">\r\nmvn archetype:generate \\\r\n\t-DarchetypeCatalog=http:\/\/www.lenart.org.pl\/maven\/\r\n<\/pre>\n<p><strong>It works.<\/strong><br \/>\nPala pala\u7684\u8f93\u5165\u76f8\u5173\u4fe1\u606f\u5c31\u521b\u5efa\u597d\u4e86\u3002<br \/>\n\u4e0d\u8fc7\u8fd9\u79cd\u505a\u6cd5\u7684\u524d\u63d0\u662frepo\u6709\u4e00\u4e2a\u53eb archetype-catalog.xml \u7684\u6587\u4ef6\u3002<\/p>\n<p>\u4e0d\u559c\u6b22\u9009\u62e9\u7684\u8bdd\uff0c\u53ef\u4ee5\u7528\u4e0b\u9762\u8fd9\u4e2a\u62c9\u98ce\u5f97\u5f88\u7684\u547d\u4ee4\uff1a<\/p>\n<pre name=\"code\" class=\"brush: bash\">\r\nmvn archetype:generate \\\r\n\t-DarchetypeCatalog=http:\/\/www.lenart.org.pl\/maven\/ \\\r\n\t-B \\\r\n\t-DarchetypeGroupId=org.apache.struts \\\r\n\t-DarchetypeArtifactId=struts2-archetype-blank \\\r\n\t-DarchetypeVersion=2.1.6 \\\r\n\t-DgroupId=net.leegorous \\\r\n\t-DartifactId=smui3 \\\r\n\t-Dpackage=war \\\r\n\t-Dversion=1.0-SNAPSHOT\r\n<\/pre>\n<p>\u6ce8\uff1a-B : \u8868\u793a\u6279\u91cf\u6267\u884c\uff0c\u4e0d\u63d0\u95ee\uff0c\u4e2a\u4eba\u89c9\u5f97\u4e00\u95ee\u4e00\u7b54\u4e5f\u86ee\u6709\u8da3 \ud83d\ude1b<br \/>\n\u547d\u4ee4\u6362\u884c\u4e3a\u4e86\u663e\u793a\u65b9\u4fbf\uff0c\u4f7f\u7528\u65f6\u8bf7\u6ce8\u610f\u5728\u4e00\u884c\u5b8c\u6210\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u7684\u76ee\u7684\u5c31\u662f\u8981\u7528archetype\u6765\u521b\u5efa\u4e00\u4e2astruts2\u7684blank\u9879\u76ee\uff0cstruts2\u5b98\u7f51\u4e0a\u5199\u7684\u67092.1. &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/leegorous.net\/blog\/2009\/07\/05\/when-maven-internal-archetype-catalog-did-notwell-behaved\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u5f53maven internal archetype catalog\u4e0d\u542c\u4f7f\u7684\u65f6\u5019\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[22],"tags":[32,31],"_links":{"self":[{"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/posts\/185"}],"collection":[{"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/comments?post=185"}],"version-history":[{"count":4,"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/posts\/185\/revisions"}],"predecessor-version":[{"id":1071,"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/posts\/185\/revisions\/1071"}],"wp:attachment":[{"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/media?parent=185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/categories?post=185"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/tags?post=185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}