Maven archetype project creation through commandline

When we are creating a new web application project it is mandatory that we follow some guidelines to the project structure. Maven archetype generation flow simplifies this by providing a command line interface to generate a project structure that can be imported by Eclipse.

Commands to execute the project generation workflow

#Step 1.

Go through the command line workflow to create an archetype-webapp project with filter id 362

> mvn archetype:generate

Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 359: 362

Choose a number: 5: 5

Define value for property ‘groupId’: : MYTrialProject

Define value for property ‘artifactId’: : MYTrialProject

Define value for property ‘version’: 1.0-SNAPSHOT: :

Define value for property ‘package’: CTFWeb: : com.test.mytrial

Confirm properties configuration: Yes

#Step 2 : Create the relevant folder structure within the src folder of project by going to windows explorer or the relevant CLI

Image

 

#Step 3: Eclipse IDE import

Import the project using Import > Existing Maven Projects

Advertisements