The previous article is relatively simple.
After reading the previous content, we will go to the actual aspect, that is, creating a simple project.
1 mvn archetype:create -DgroupId=org.sonatype.mavenbook.ch03 \2 -DartifactId=simple \3 -DpackageName=org.sonatype.mavenbook
So we got the first blow into the maven field.
It was really cool, and there was a bunch of errors. I read the book for a long time. The command was correct and the case was the same. Many of my friends are the same as me, so I don't know why.
The Web http://www.cnblogs.com/luhouxiang/archive/2011/09/02/2164053.html is finally found through Google through multiple searches
And http://maven.apache.org/archetype/maven-archetype-plugin/create-mojo.html
Now the truth is that the original create parameter is like this.
1 mvn archetype:create 2 -DgroupId=[your project's group id]3 -DartifactId=[your project's artifact id]4 -DarchetypeArtifactId=maven-archetype-archetype
It turns out that "\" is not usable. "\" indicates that the command is not completed in Linux, and this syntax does not exist in windows ......
It's done right away.
The generated directory structure is as follows:
1 simple 2 |--pom.xml 3 |--src 4 |--main 5 | |--Java 6 | |--org 7 | |--sontype 8 | |--mavebook 9 | |--App.java10 |--test11 | |--Java12 | |--org13 | |--sontype14 | |--mavebook15 | |--AppTest.java
Next article: describes the creation command MVN archetype: Generate, which is better than create.