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.
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 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.
maven-archetype-quickstart An archetype which contains a sample Maven project.
maven-archetype-simple An archetype which contains a simple Maven project.
if get errors
fixed it by adding the maven archetype catalog to eclipse. Steps are provided below:
the default archetype number now is 1092
1092: remote -> org.apache.maven.archetypes:maven-archetype-quickstart (An archetype which contains a sample Maven project.)
You may want to consider Java Archetype: it has reasonable defaults for quickly starting a Java project following best practices, including JUnit tests. I conceived it as a modern successor of maven-archetype-quickstart.
For more information about alternatives, here is a part of that project’s README (it provides more links than copied here).
The official quickstart archetype
The official archetype (mentioned by Apache’s Maven Getting Started Guide and by the Apache Maven Cookbook) for simple Java projects is maven-archetype-quickstart, or org.apache.maven.archetypes:maven-archetype-quickstart in full.
It should, IMHO, be considered deprecated, as it suffers several weaknesses.
An important problem is that it creates projects that depend on JUnit 4. The current version, JUnit 5, differs significantly, providing among other an improved API.
Minor weaknesses: its default version is 1.0-SNAPSHOT, which should be 1.0.0-SNAPSHOT to follow the recommended and usual scheme.
Another minor weakness: it creates projects configured for a 1.7 JVM. This may be appropriate if you particularly need to support old installs, but opting for a reasonably recent JVM is a more reasonable default rule for new projects. For example, Java 8 introduced lambda expressions, which you probably do not want to miss out.
My archetype also provides logging by default, which I think is useful, scales better than sysout and does not hurt, and Guava, which I think usefully enriches Java.
Other quickstart archetypes in Maven Central
In order to join efforts if possible and avoid wasteful duplication, I actively searched for other archetypes that would have the same aim as mine: provide a simple archetype with reasonable defaults to easily start a modern Java project. (This was mostly done around June 2020.)
A general search on the internet led me to The Practical Developer. When contacted, he wrote to me (by e-mail) that he does not work on his archetype regularly and therefore preferred to decline collaborating on such a project.
As searches on the net did not reveal other useful results, and as I found no specialised search tool suitable for my needs, I implemented a simple archetype browser. It lists all the archetypes available in Maven Central. There are far too many to review manually, thus, I selected those whose groupId and artifactId existed since at least three years and have been updated during the last year, in hope of finding projects that are maintained on the long run, which I suppose indicates more probably a good quality project. (Of course this filter may have missed good quality archetypes that perfectly match the stated goal; I have no way to know. As a case in point, this very archetype does not pass that filter as I have changed its artifactId over time.)
I then filtered manually the resulting list on the basis of the archetypes descriptions found in their POM, and gave a further look (on the official website, typically) for a few promising archetypes among them. Only com.github.ngeor:archetype-quickstart-jdk8 revealed to be a suitable candidate. But its author wrote to me that he is “not really using/maintaing the archetype much these days”.