Suitable Maven archetype for a utils Java library

1.1k Views Asked by At

I want to create a simple Java library with some common utils/helper functionality I use on several projects.

I'd like to use the mvn archetype:generate for this, but there are thousands of archetypes to choose from and it's rather difficult to figure out which would be suitable for my need.

Maybe the maven-archetype-quickstart is good enough, but I'm wondering if there is not a better one for this.

1

There are 1 best solutions below

0
Michael Katt On

In my eyes maven-archetype-quickstart fits the best for your project. It provides the default project structure for Java Projects. You could use maven-archetype-simple also. It is adding the site.xml file. All other default maven archetypes would not fit for your simple Java project. Have a look at https://maven.apache.org/archetypes/index.html

You should configure the version of Java Compiler for Maven to use other than default 1.4. https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html

EDIT: You could use the java-archetype from Olivier Cailloux on GitHub https://github.com/oliviercailloux/java-archetype which claims to improve the created project configuration.