views:

75

answers:

3

Quoted from here:

mvn archetype:generate -DgroupId=org.sonatype.mavenbook.simple \
                                         -DartifactId=simple \
                                         -DpackageName=org.sonatype.mavenbook \
                                         -Dversion=1.0-SNAPSHOT

And I also have to specify an archetype number...

It seems that maven isn't satisfied to be just a Java build tool,but want to control all aspect of developing...

Can someone recommend a really dedicated build tool for Java?

A: 

Alternate build tools: Ant (lots of configuration), Gradle (conventions again, less verbose than maven)

Maven is good if you don't want to fight its conventions. Your example above is just asking you to define your package, jar name, and version string (all things you need to do if this code is ever going to other people). Also you don't need to start with an archetype if you understand how to (or have a tool) to generate a pom and understand where maven wants you to put your files.

Rob Spieldenner
+4  A: 

You're misunderstanding what an archetype is, it's simply a template for creating new projects.

You don't need to use one if you don't want to, you are free to create your own pom.xml and put your source code and tests wherever you want, as long as you configure the non-standard values in your POM.

Maven doesn't "want to control all aspect of developing", it is a tool which is based around a set of best practices and standards (standard layouts, build lifecycle, projects should have versions, the idea of release vs snapshot dependencies, etc.).

You are free to not use these best practices, but to do so, you need to configure Maven for what you want.

The nice part about Maven is that when you do follow the standards, there is often nothing to configure. It's only when you need non-standards that you need to configure.

matt b
+1  A: 

A Maven project has a groupId, an artifactId and a version (OMG, 3 properties) so you need to set them:

mvn archetype:generate -B -DgroupId=org.sonatype.mavenbook.simple \
                          -DartifactId=simple \
                          -Dversion=1.0-SNAPSHOT 

You don't like it? It's too much effort? Don't use Maven.

It seems that maven isn't satisfied to be just a Java build tool, but want to control all aspect of developing...

Maven is more than just a build tool. It's not what you want? Don't use Maven.

Can someone recommend a really dedicated build tool for Java?

It's the third time you ask for recommendations (first time here, second time here) and since you're just ignoring the answers suggesting Maven, Ant, Make, Buildr, Gradle, Gant, I would recommend javac.

Pascal Thivent