Web应用架构-WebApp Server_01 intellij idea创建maven工程

【Maven简介】

    1. Maven工具:Maven项目对象模型(POM),可以通过一小段描述信息来管理项目的构建,报告和文档的软件项目管理工具。

    2. Settings.xml文件:maven的配置文件,重点关注:proxies代理设置。

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
 3     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 4     xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
 5 
 6     <localRepository>D:developmentmaven
epo_github</localRepository>
 7 
 8     <activeProfiles>
 9         <activeProfile>ali</activeProfile>
10     </activeProfiles>
11 
12     <profiles>
13         <profile>
14             <id>ali</id>
15             <repositories>
16                 <repository>
17                     <id>central</id>
18                     <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
19                     <releases>
20                         <enabled>true</enabled>
21                     </releases>
22                 </repository>
23             </repositories>
24             <pluginRepositories>
25                 <pluginRepository>
26                     <id>central</id>
27                     <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
28                     <releases>
29                         <enabled>true</enabled>
30                     </releases>
31                 </pluginRepository>
32             </pluginRepositories>
33         </profile>
34     </profiles>
35 
36     <proxies>
37         <proxy>
38             <id>my-proxy</id>
39             <active>true</active>
40             <protocol>http</protocol>
41             <host>proxyhk.**.com</host>
42             <port>8080</port>
43             <username>***</username>
44             <password>***</password>
45             <nonProxyHosts>*10.*</nonProxyHosts>
46         </proxy>
47     </proxies>
48 </settings>
View Code

  3. pom.xml文件:各个标签是对项目生命周期、依赖管理的配置。   

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <project xmlns="http://maven.apache.org/POM/4.0.0"
 3          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 4          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 5     <modelVersion>4.0.0</modelVersion>
 6 
 7     <groupId>pers.ztj</groupId>
 8     <artifactId>xinang</artifactId>
 9     <version>1.0-SNAPSHOT</version>
10 
11         <dependencies>
12             <dependency>
13                 <groupId>org.springframework</groupId>
14                 <artifactId>spring-web</artifactId>
15                 <version>4.2.1.RELEASE</version>
16             </dependency>
17         </dependencies>
18 </project>
View Code

    4. Maven构建:可了解maven常用命令,比如:

       

 【intellij idea创建Maven工程】

  啊

原文地址:https://www.cnblogs.com/zhitianji/p/9585898.html