Maven project created from Old (1.x) Archetype

The version you are using as well as the guide you are referring is current enough. You can ignore the message. The project that is created does work fine with the latest maven.

As for junit, you can change the version of the dependency appropriately. The project that is created using archetype:generate is only an indicative one, which is meant to be customized.

In addition to what you are looking at, you could also look Maven: The Complete Reference


If you include -DinteractiveMode=true in your mvn archetype:generate command:

mvn archetype:generate \
    -DgroupId=org.obliquid.helpers \
    -DartifactId=obliquid-helpers \
    -Dversion=0.1 \
    -DinteractiveMode=true

you are presented with a (large) catalog of available mvn archetypes, along with a brief description of each.

Currently, a couple of the best simple Java app archetypes in that list are:

1844: remote -> org.spilth:java9-minimalist-quickstart

and

1966: remote -> pl.org.miki:java8-quickstart-archetype

The second one includes a test scope that uses JUnit version 4.11 for unit-tests. To use that archetype you just need to specify the archetypeGroupId and archetypeArtifactId as in:

mvn archetype:generate \
    -DarchetypeGroupId=pl.org.miki \
    -DarchetypeArtifactId=java8-quickstart-archetype \
    -DgroupId=org.obliquid.helpers \
    -DartifactId=obliquid-helpers \
    -Dversion=0.1

For some reason mvn archetype:generate assumes archetypeVersion=1.0 even when the archetype metadata indicates a different version for the latest/release.

To specify an archetype version besides 1.0 you just need to define a value for the archetypeVersion property, e.g.

mvn archetype:generate \
    -DarchetypeGroupId=org.apache.maven.archetypes \
    -DarchetypeArtifactId=maven-archetype-quickstart \
    -DarchetypeVersion=1.1 \
    -DgroupId=org.obliquid.helpers \
    -DartifactId=obliquid-helpers \
    -Dversion=0.1 \
    -DinteractiveMode=true

Find out what versions are available by visiting https://repo.maven.apache.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/ with a web browser.