What archetype to choose for a simple java project

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?


Solution 1:

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.

Solution 2:

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.

Solution 3:

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.