Maven-02-Use IntelliJ IDEA to create a maven project on windows

1. Goal

How to create a maven project on IntelliJ IDEA and associate the local maven environment

2. Description

This time the environment is a single windows, and tomcat, maven, jdk, IntelliJ IDEA are installed on the host.

Three, general steps

1. Create a new test maven rapid framework

1-1. Click [File---New---Project] in turn

1-2. Create a new test maven rapid framework

● Click on the Maven project on the left

● Project SDK: Choose a jdk version (it is recommended to install a jdk-8u281-windows-x64 by yourself, the jdk has been placed in the network disk [My software---java4windows])

● Check "Create from archetype"

● 点选“org.apahce.maven.archetypes:maven-archetype-quickstart”

● Click "Next"

1-3. Enter the project name

2. Change the maven settings of the current project

Click [Build, Execution, Deployment---Build Tools---Maven] in turn, and then modify the following

● Maven home path: C:/software/apache-maven-3.6.3 (it is your maven root directory, there are conf, bin and other folders under it)

● User settings file: C:\software\apache-maven-3.6.3\conf\settings.xml (the absolute path of your maven settings file)

 

 

Then go to the repository directory C:\kahn and you will find that there are already some things

 

 

The following is a screenshot after creating the maven web project framework

3. Configure the operating environment of the maven web project

Add local tomcat environment configuration

4. Modify the home page index.jsp of the web project

<%@ page language="java" contentType="text/html; charset=utf-8"  import="java.net.InetAddress"
         pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>欢迎访问kahn index.</title>
</head>
<body>
<h1>version 1</h1>
<h1>123abc欢迎访问kahn的主页</h1>
<img src="./images/girl.jpg" alt="模特 - 美女-图片宽度为原尺寸的百分之30 width=30%" width="30%">
<br />

<%
    InetAddress addr = InetAddress.getLocalHost();
    out.println("主机地址:"+addr.getHostAddress());
    out.println("主机名:"+addr.getHostName());
%>

</body>
</html>

The following is the running effect of jsp.

--------------------------kahn---ok-----------February 14, 2021 16: 55:40----------------------------

Guess you like

Origin blog.csdn.net/xoofly/article/details/113250428