Fork me on GitHub

How the Archetype Plugin know about new archetypes?

Creation/Deployment behaviour
    5. archetype developer using local version 

 

 archetype created using archetpe:create-from-project -Darchetype.phase=install 

 the newly created archetype is copied in the local repository 

 and the archetype-catalog.xml file located at the root of the repository is updated with the archetype information 

 

 when using in archetype:create -Darchetype.catalog=local 

 the archetype must be specified using -Darchetype.groupId, -Darchetype.artifactId 

 only the local repository is used and the LATEST version in it is used 

 or selected with -Darchetype.selectVersion 

 or specified with -Darchetype.version
        configuration behaviour 

 returns an incomplete creation request
            determine archetype's groupId, artifactId, version 

 -> defaults to resolve, overridden by property file, overridden by -D 

 resolve package using (-Dlanguages languages can be found in property file instead) 

 -> defaults to resolve, overridden by property file, overridden by -D 

 determine additional properties 

 -> ask if interactive, overridden by property file only
        creation behaviour 

 post creation goals (package/install/deploy)
            determine filesets using: 

 -> package, languages, filtereds, multi-module 

 determine pom rewriting using: 

 -> keepParent, additional properties 

 create archetype files using: 

 -> package, common properties, additional properties 

 create archetype's metadata file 

 create archetype's pom using 

 -> archetype's id, copying devs, license, ... AND deploymentManagement
    6. archetype developer deployment the archetype 

 

 archetype create using archetype:create-from-project -Darchetype.phase=deploy 

 

 the deployment url used is taken from the initial project 

 credentials are automatically configured by Maven 

 the catalog file is located at the root of the repository URL and is named archetype-catalog.xml 

 

 the deployment url and credentials could be overridden to use staging repositories, but how? 

 

 proxies are automatically configured by Maven 

 

 synchronization between repositories of catalog files is easy as they don't define any repository URL
        deployment credentials:
            initialPom.deploymentManagement 

 -> remote URL or remote snapshot URL 

 settings.servers
        deployment artifact:
            initialPom.groupId or archetype.groupId in property file or in -D 

 initialPom.artifactId +'-archetype' or archetype.artifactId in property file or in -D 

 initialPom.version or archetype.version in property file or in -D
        deployment metadata:
            deploy versions metadata as any artifact 

 use deploymentManagement to update remote catalog