IntelliJ IDEA14 and MAVEN series: creating Java Web Projects using IntelliJ idea 14 and maven 7 (i)

Source: Internet
Author: User

Intellij idea as the best Java IDE, it's easier to create a MAVEN project, but to create a MAVEN Web project or to modify some of the configurations, let's summarize them.1 Preface

In the project creation, IDEA provides a number of project templates, such as the Spring MVC template, which can be directly created with a MAVEN-based spring MVC demo, with all configurations set up and ready to be used for direct compilation of the deployment.

The first time you create a MAVEN Web project yourself, either create a SPRINGMVC project to modify it, create a MAVEN project (not a Web project), add a WebApp directory to add the configuration Web. xml file, and add a website moudle. Configuration properties, and so on.

Tomcat 7, Maven, IntelliJ idea 14 related introduction, download, installation, and environment variable configuration is not introduced, directly create the project;

2. Create a MAVEN Web project

new--project--maven--tick the Create from archetype check WebApp

Next, fill in Groupid,artifactid and version

Next, adding a parameter to the properties archetypeCatalog=internal , without this parameter, will be very slow when Maven builds the skeleton, and sometimes it will get stuck directly.

Explanations from the Internet:

Archetypecatalog represents the plug-in uses the archetype metadata, does not add this parameter when the default is Remote,local, that is, the central warehouse archetype metadata, because the central warehouse archetype too much, so the result is very slow, Specify internal to indicate that only internal metadata is used.

Next, fill in the project name and module name.

Click Finish.

The first time you use it, you may need to download archetype WebApp plug-ins Sometimes it may take a long time for the network to be bad.

After you've created it, you'll need to wait a moment to load the appropriate configuration file, as shown in the following:

Now that the project is already a Maven WebApp project, we also need to have project structure configured

3 Configuration instructions for MAVEN Web projects

Configuration of artifaces in Project structure JDK and language level

Create a new Java folder under the main folder and set it as the source code folder.

Adds an externally dependent jar package to the module.

The addition of Tomcat dependency is to satisfy servlet and jsp rely on Tomcat as a servlet container for enhanced servlet jsp API.

Adding a project requires a jar package dependency.

Set the artifact. If there is no default, add, fill in the relevant name, select the relevant type;

Basic setup completed;

4. Set Tomcat

Add Tomcat, modify name. Add artifacts

Modify the relevant port number, may be used, need to modify;

Tomcat configuration is basically complete, start running;

Creating a Java Web project with IntelliJ Idea 14 and Maven 7 is basically done;

To be continued after ...

IntelliJ IDEA14 and MAVEN series: creating Java Web Projects using IntelliJ idea 14 and maven 7 (i)

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.