Babu
Babu

Reputation: 3

What is the use of the property archetypeVersion in maven?

I am learning Maven by creating a simple project using maven-archetype-quickstart. I found a property called archetypeVersion which has the default value RELEASE. I would like to know the purpose of this property and what other possible values can it contain other than RELEASE.

Upvotes: 0

Views: 4803

Answers (1)

bhavya.work
bhavya.work

Reputation: 421

Maven has a unique project identifier that basically is a combination of three things

  1. group
  2. artifact
  3. version

So, archetypeVersion is the value that goes into version when you are creating your project.

For example a combination of group:artifact:version will be

com.test.example:myexample:1.0-SNAPSHOT

Most project use the following versioning system by convention

  1. SNAPSHOT
  2. RELEASE-CANDIDATE or RC
  3. RELEASE

The value of this version can be anything , the above values are the usual convention.

SNAPSHOT usually means the most current version of code that you are working on, usually only unit tested , sometimes not even that.

RELEASE-CANDIDATE is usually something that is out for users to do acceptance test.

RELEASE as you can guess is the final version which can be deployed in PROD.

So if you are running the following command

mvn archetype:generate                                  \
  -DarchetypeGroupId=<archetype-groupId>                \
  -DarchetypeArtifactId=<archetype-artifactId>          \
  -DarchetypeVersion=<archetype-version>                \
  -DgroupId=<my.groupid>                                \
  -DartifactId=<my-artifactId>

you would have to put the version that you want your project to have in <archetype-version>

Upvotes: 2

Related Questions