www.sqnote.cn

地址:http://maven.apache.org/plugins/   插件 tool-->archetype

一直来都是用archetype:create创建项目的,原来archetype:generate可以更方便。

archetype:generate  vs archetype:create

archetype:create这样创建太麻烦了:

mvn archetype:create 
-DgroupId=[your project's group id]
-DartifactId=[your project's artifact id]
-DarchetypeArtifactId=maven-archetype-archetype


archetype:generate 多么精巧:
mvn archetype:generate   调用internal库进行创建

mvn archetype:generate -DarchetypeCatalog=local   调用local库进行创建

mvn archetype:generate -DarchetypeCatalog=url 调用 url/archetype-catalog.xml 提供的库进行创建。

备注:
.m2/archetype-catalog.xml

<?xml version="1.0" encoding="UTF-8"?>

<archetype-catalog>

    <archetypes>

        <archetype>

            <groupId>com.web2common.gae</groupId>

            <artifactId>gae-web2common</artifactId>

            <version>1.0</version>

            <repository>http://localhost/maven2</repository>

            <description>GAE maven2 Web Application</description>

        </archetype>

    </archetypes>

</archetype-catalog>

 

Tags: mvn

By SQ post on 2009-4-21 15:02 PM Java Web |

添加评论

4+9