maven ArchetypeDescriptor

来源:互联网 发布:九鼎投资 知乎 编辑:程序博客网 时间:2024/05/23 14:23

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.

AttributeTypeDescriptionnameStringName of the Archetype, that will be displayed to the user when choosing an archetype.partialbooleanIs this archetype representing a full Maven project or only parts?
Default value isfalse.ElementTypeDescriptionrequiredProperties/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.

AttributeTypeDescriptionkeyStringKey value of the property.ElementTypeDescriptiondefaultValueStringDefault 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.

AttributeTypeDescriptionfilteredbooleanFilesets 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} 字段。packagedbooleanFilesets 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类自动生成包名对应的文件夹,测试不起作用。encodingStringEncoding to use when filtering content.ElementTypeDescriptiondirectoryStringThe 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.

AttributeTypeDescriptionidStringThe module's artifactId.dirStringThe module's directory.nameStringThe module's name.ElementTypeDescriptionfileSets/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
原创粉丝点击