Build maven with the new version of IntelliJ IDEA, and create a web project with Maven (Graphic tutorial), intellijmaven

Source: Internet
Author: User

Build maven with the new version of IntelliJ IDEA, and create a web project with Maven (Graphic tutorial), intellijmaven

I have never tried maven to manage projects before, but it is inconvenient to manually find the package export package. So today I started a maven test with IDEA of version 2016.

Open IDEA and create a new project:

Select Maven and jdk on your computer:

Next we will customize the GroupId and ArtifactId. Here it is just a demo, so we just name it

Then customize the project name, Finish:

Maven created

In maven, the main/java and main/resources directories are generated under src during the first creation. The test directory in src must be created by yourself, and the code in the test directory will not be released, used for testing.

Create a web project in maven:

Right-click Add Framework Support and the Project Creation option is displayed:

Select a web project and click OK.

Then configure the web Project dependency package under pom. xml:

The idea prompts Maven projects need to be imported. Click Import ChangesEnable Auto-Import to enable maven to automatically download the Import package.

View the External Libraries under the project and you can find that the dependency package has been downloaded:

Next, create a servlet in the src/main/java directory.

Finally, configure the tomcat server:

Finally, publish and run the program, and then enter the servlet request in the browser:

Click OK

The servlet successfully processes the request response. At this point, the maven project is successfully created.

Summary

The above is a new version of IntelliJ IDEA that I will introduce to you to build maven and use Maven to create a web project. I hope it will help you. If you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!

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.