Just need to know while generating project from a my own archetype, how to put restriction while user enters the artifactId. I require that user could only be able to enter less or equal to 5 character artifactId. otherwise mvn should ask again to enter an artifactId with less than 5 chars.
How about this: "mvn" is a script that runs the JVM to run Maven. Change the script and have it verify the artifact name length before running the JVM. If you don't want to change the mvn script, rename it and supply a new script named mvn which checked the name length and calls the renamed mvn script.
I doubt that there is any way, within Maven itself, to restrict the name length (without writing your own mojo).