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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s