Maven learning notes (2)-MVN archetype: Create description

Source: Internet
Author: User
Tags sonatype

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.