IntelliJ IDEA14 and Maven series: Use IntelliJ IDEA 14 and Maven 7 to create java web Project (1), intellijmaven

Source: Internet
Author: User

IntelliJ IDEA14 and Maven series: Use IntelliJ IDEA 14 and Maven 7 to create java web Project (1), intellijmaven
Intellij IDEA is the best Java IDE. It is relatively simple to create a Maven project. However, to create a Maven Web project, you still need to modify some configurations.

During project creation, IDEA provides many project templates, such as Spring MVC templates. You can directly create a Maven-based Spring MVC demo. All the configurations have been set, you can directly compile and deploy it.

When you first create a maven web project, either create a springmvc project to modify it, or create a maven Project (not a web project) and add the webapp directory to add the web configuration. xml file, add web moudle, and configure attributes.

Introduction, download, installation, and environment variable configuration related to Tomcat 7, Maven, and IntelliJ IDEA 14 are not described. You can directly create a project;

2. Create a Maven Web Project

New -- project -- maven -- select create from archetype and select webapp

Next, enter GroupId, ArtifactId, and Version

Next, add a parameter in PropertiesarchetypeCatalog=internalWithout this parameter, it will be very slow when maven generates the skeleton, and sometimes it will get stuck directly.

Explanations from the Internet:

ArchetypeCatalog indicates the archetype metadata used by the plug-in. If this parameter is not added, the default value is remote and local. That is, the archetype metadata of the central warehouse is too large, specify internal to indicate that only internal metadata is used.

 

Next, enter the project name and module name.

 

Click Finish.

During the first use, you may need to download the archins of archetype webapp. Sometimes the network is poor and it may take a long time, but it will take a long time.

After the creation, wait a moment and load the corresponding configuration file, as shown in:

Now the project is a Maven webapp project, and we need to configure the project structure.

3. Maven Web project configuration instructions

Configure JDK and language level for Artifaces in Project Structure

 

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

 

Add a jar package with external dependencies to the module.

Tomcat dependency is added to meetservletAndjspDepends on, tomcat asservletContainer improvedservletAndjsp.

Add the jar package dependency required by the project.

 

Set artifact. If no default value exists, add it, enter the relevant name, and select the relevant type;

 

The basic settings are complete;

4. Set tomcat

 

Add tomcat, modify name. Add Artifacts

 

Modify the relevant port number, which may have been used;

 

Tomcat configuration is basically complete and starts to run;

 

 

 

Using IntelliJ IDEA 14 and Maven 7 to create a java web project is basically complete;

To be continued later...

 

Related Article

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.