Archetypes

Maven - Templating Toolkit



What is in a maven project ?

Maven archetype is a template used to create a skeleton app to build on.

Structure

archetype-metadata.xml


  
    {...}
  

  
    {...}
  

  
    {...}
  

See: archetype-descriptor.html

archetype-metadata.xml

requiredProperties


   
       1.0.0-SNAPSHOT
       
       ^(\d+\.)(\d+\.)(\d+)(-SNAPSHOT)$
   

archetype-metadata.xml

fileSets


    
    
        __gitignore__
        __Jenkinsfile__
    


    src/main/java/__packageInPathFormat__
    
        **/*.java
    

archetype-metadata.xml

modules


  

    
      
        
        
        
      
    

    
      ...recursion...
    
  

Archetype to generate an archetype ???

How ?

archetypeGroupId org.apache.maven.archetypes
archetypeArtifactId maven-archetype-archetype
archetypeVersion 1.3 (or newer)
mvn archetype:generate 
-DarchetypeGroupId=org.apache.maven.archetypes 
-DarchetypeArtifactId=maven-archetype-archetype 
-DarchetypeVersion=1.3

Or

DCC Rest Archetype

archetypeGroupId com.onea****etype
archetypeArtifactId rest-archetype
archetypeVersion 1.0.0-SNAPSHOT

Maven

mvn archetype:generate 
-DarchetypeGroupId=com.one****
-DarchetypeArtifactId=rest-archetype
-DarchetypeVersion=1.0.0-SNAPSHOT 
-DdeveloperName=****
-DdeveloperMail=**** 
-DdeveloperId=****

mvnj

mvnj -g rest-archetype 1.0.0-SNAPSHOT

Time for a Demo!

DCC Initializr

Questions ??

Fin

Tobias Spindler