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

本文介绍了Maven项目对象模型(POM)及其如何通过描述信息管理项目的构建、报告和文档。重点讲解了Settings.xml文件中代理设置及pom.xml文件中生命周期与依赖管理的配置。

【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:\development\maven\repo_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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值