First, the Archetype Plugin asks the user to provide the common properties' values (archetype.groupId, archetype.artifactId, archetype.version, groupId, artifactId, version, package).
Then it asks for additional properties.
Using the project's directory as sources, filteredExtensions and languages properties, the module tree; the Archetype Plugin searches for relevant filesets indexed by module.
Using the relevant filesets, the module tree, the resolved properties; the Archetype Plugin creates the archetype's resources.
Then it creates the archetype's descriptor.
Finishing by creating the POM for the archetype as a project.
Optionally, after creating the archetype, the Archetype Plugin installs the archetype in the local repository. And it updates the local catalog.
Optionally, after installing the archetype, the Archetype Plugin deploys the archetype to the remote repository.
The default behaviour is to operate in batch mode. The interactive mode is optionally used.
In batch mode, the additional properties can only be defined using a property file. This file can also contain the other properties, both the common and filteredExtensions and languages.
In each module's directory and excluding submodules trees, the Archetype Plugin sorts the files by languages, filteredExtensions and sensible default base paths (src/main/languages, src/main/siblings, src/test/languages, src/test/siblings, ...).
This defines a three-dimensional matrix. Each sorted group (matrix' cases) becomes a resolved fileset.