maven ArchetypeDescriptor

ArchetypeDescriptor

This is a reference for the Archetype descriptor used to describe archetypes's metadata.

The metadata about an archetype is stored in the archetype-metadata.xml file located in the META-INF/maven directory of its jar file.

<archetype-descriptor xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
  name=.. partial=.. >
  <requiredProperties>
    <requiredProperty key=.. >
      <defaultValue/>
    </requiredProperty>
  </requiredProperties>

  <fileSets>
    <fileSet filtered=.. packaged=.. encoding=.. >
      <directory/>
      <includes/>
      <excludes/>
    </fileSet>
  </fileSets>

  <modules>
    <module id=.. dir=.. name=.. >

      <fileSets>
        <fileSet filtered=.. packaged=.. encoding=.. >
          <directory/>
          <includes/>
          <excludes/>
        </fileSet>
      </fileSets>

      <modules>
        <module>...recursion...<module>
      </modules>
    </module>
  </modules>
</archetype-descriptor>

archetype-descriptor

No description.

Attribute Type Description
name String Name of the Archetype, that will be displayed to the user when choosing an archetype.
partial boolean Is this archetype representing a full Maven project or only parts?
Default value isfalse.
Element Type Description
requiredProperties/requiredProperty* List<RequiredProperty> (Many) List of required properties to generate a project from this archetype.
fileSets/fileSet* List<FileSet> (Many) File sets definition.
modules/module* List<ModuleDescriptor> (Many) Modules definition.

requiredProperty

Definition of a property required when generating a project from this archetype.

Attribute Type Description
key String Key value of the property.
Element Type Description
defaultValue String Default value of the property.

fileSet

A fileset defines the way the project's files located in the jar file are used by the Archetype Plugin to generate a project. If file or directory name contains __property__ pattern, it is replaced with corresponding property value.

Attribute Type Description
filtered boolean Filesets can be filtered, which means the selected files will be used as Velocity templates. They can be non-filtered, which means the selected files will be copied without modification. 
Default value isfalse. 是否解析模板文件的${XXX} 字段。
packaged boolean Filesets can be packaged, which means the selected files will be generated/copied in a directory structure that is prepended by the package property. They can be non-packaged, which means that the selected files will be generated/copied without that prepend.
Default value isfalse.

翻译:定义的java类自动生成包名对应的文件夹,测试不起作用。
encoding String Encoding to use when filtering content.
Element Type Description
directory String The directory where the files will be searched for, which is also the directory where the project's files will be generated.
includes/include* List<String> (Many) Inclusion definition "à la" Ant.
excludes/exclude* List<String> (Many) Exclusion definition "à la" Ant.

module

No description.

Attribute Type Description
id String The module's artifactId.
dir String The module's directory.
name String The module's name.
Element Type Description
fileSets/fileSet* List<FileSet> (Many) File sets definition.
modules/module* List<ModuleDescriptor> (Many) Modules definition.

原文地址:http://maven.apache.org/archetype/archetype-models/archetype-descriptor/archetype-descriptor.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值