Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 414
Jason Avatar asked Aug 23 '11 08:08

Jason


People also ask

What is archetype for Java project?

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.

What is Maven project archetype?

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.


3 Answers

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.

like image 170
Oleksandr Avatar answered Oct 19 '22 09:10

Oleksandr


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.

like image 22
marioosh Avatar answered Oct 19 '22 09:10

marioosh


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.

like image 18
Oh Chin Boon Avatar answered Oct 19 '22 09:10

Oh Chin Boon