mvn archetype:generate provides way too many options and I am looking to create a simple java utility with junit test cases. I would like to know what archetype I should be using here?
What is Archetype? In short, Archetype is a Maven project templating toolkit. An archetype is defined as an original pattern or model from which all other things of the same kind are made. The name fits as we are trying to provide a system that provides a consistent means of generating Maven projects.
Overview. A Maven archetype is an abstraction of a kind of a project that can be instantiated into a concrete customized Maven project. In short, it's a template project template from which other projects are created.
I use two archetypes. It depends on what kind of application you will create.
If you want a web application, use maven-archetype-webapp, or if you want a simple application use maven-archetype-quickstart. They are useful because you will be able to expand them with no problem.
I'm using command like below:
mvn archetype:generate -Dfilter=org.apache.maven.archetypes:
I will get a short list of achetypes only from org.apache.maven.archetypes
groupId. The good ones for starting is maven-archetype-quickstart
and maven-archetype-webapp
like my predecessors said.
When you do a mvn archetype:generate
, a default selection appears in enclosing curly brackets ()
, e.g. (1274)
, if you scroll up to see what #1274 is, it is usually the default Java archetype to try out or start out with, if doing simple Java projects, so is safe to select.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With