TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Apache Maven

Maven Archetypes

Introduction

Maven Archetypes allow us to build archetype containers for different projects. These containers contain POM, src, test, resources, etc in a specific directory structure. The contents and the directory structure depends on the what archetype container was built.

Let’s get started.

We can use the new maven project wizard or the command line plugin options.

New >> Maven Project >>  To select uncheck archetype selection.

 

Maven_Archtype_1

 

There are several archetype containers available that we can use depending on the type of project we trying to build.

We can select an Archetype the best fits the project.

 

New_Maven_Project

 

In this step, we can select the archetype. For example,

maven-archetype-quickstart
An archetype which contains a sample maven project.

maven-archetype-webapp

An archetype which contains a sample Maven web app project.

maven-archetype-j2ee-simple
An archetype which contains a simplified sample J2EE application.

Maven_Archtype_2

 

This builds the corresponding project structure for us to get started with our new project. It generates the desired project structure depending on the application that we try to build with our selection.

Using Command Line

We can also do this via command line using maven archetype plugin:

To create a simple java application we can use the following command as shown below:

mvn archetype:create -DgroupId=[project_group_id] -DartifactId=[project_artifact_id] -DarchetypeArtifactId=maven-archetype-quickstart

Related Posts

Maven Download Verification Win11

Apache Maven /

Download Maven on Windows 11

Invalid Target Java Error

Apache Maven /

Fix Fatal Error compiling: Invalid target release in Maven Project

Maven Project from archetype

Apache Maven /

Create Maven Project from Archetype in NetBeans

Create New Project

Apache Maven /

Create a Maven Project skip archetype

Maven Download Button

Apache Maven /

Install Maven on Ubuntu Linux

‹ Maven Integration plugin for Eclipse IDE› Maven Archetype plugin command line

Recent Posts

  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version