Build a HelloWorld maven project with Maven

Source: Internet
Author: User

1. Download maven

Choose a newer version down

2. Configuring M2_home Environment variables

Unzip first, create a new user variable m2_home, add the bin directory to the PATH variable

3. Test whether the installation is successful: Mvn-version

4, in a directory input MVN archetype:generate, to wait a while

The first time to download a lot of jar package, to generating project in Interactive mode to wait a long time do not close, continue to wait

5, let you enter Groupid:com.hy input artifactid:maven_1 Other default return, show the project build successfully, you can see in the current directory there is a maven_1 maven project

6, Packaging: In the directory of maven_1 input: MVN package Wait, a moment the project more than a target directory, there is a project jar

You can test JAVA-CP target/xx.jar com.hy.App output a Helloword

It worked!

Build a HelloWorld maven project with Maven

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: 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.