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=internal
Without 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 meetservlet
Andjsp
Depends on, tomcat asservlet
Container improvedservlet
Andjsp
.
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...