Maven--要点笔记
2015-07-23 16:38
302 查看
--maven笔记
1.maven命令
2.archetype插件:用于创建符合maven规定的目录骨架
命令: mvn archetype:generate
3.
坐标:构件
仓库: 本地仓库和远程仓库
镜像仓库 :http://maven.net.cn/content/groups/public
更改本地仓库位置
4.maven生命周期:
clean 清理项目
pre-clean 执行清理前的工作
clean 清理上一次构建生成的文件
post-clean 执行清理后的文件
default 构建项目(核心)
compile test package install
site 生成项目站点
pre-site 在生成项目站点前要完成的工作
site 生成项目的站点文件
post-site 在生成项目站点后要完成的工作
site-deploy 发布生成的站点到服务器上
5.maven提供的一些插件
6.pox.xml解析:
设置依赖是否可选
<optional>
排除依赖传递列表
<exclusions> <exclusion>
依赖管理
<dependencies> <dependency>
插件
<build> <plugins> <plugin>
子模块继承父模块
<parent>
模块
<modules> <module>
依赖范围: --参数(compile(默认)\provided(编译、测试有效)\runtime(测试、运行)\test(测试)\system(编译、测试、可移植差)\import(导入的范围,只使用在dependencyManagement中,表示从其他的pom中导入dependency配置))
<scope>
依赖传递 :
依赖冲突:
原则:
短路优先,
先声明先优先(路径长度一样)
7.聚合和继承
聚合(modules module标签)
继承
举个例子:
--父类pom:
<properties>
<junit.version>4.0.0</junit.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<dependencies>
</dependencyManagement>
--子类pom:
<parent>
父pom坐标
</parent>
8.maven使用Jetty 和 tomcat服务运行web项目
1.maven命令
2.archetype插件:用于创建符合maven规定的目录骨架
命令: mvn archetype:generate
3.
坐标:构件
仓库: 本地仓库和远程仓库
镜像仓库 :http://maven.net.cn/content/groups/public
更改本地仓库位置
4.maven生命周期:
clean 清理项目
pre-clean 执行清理前的工作
clean 清理上一次构建生成的文件
post-clean 执行清理后的文件
default 构建项目(核心)
compile test package install
site 生成项目站点
pre-site 在生成项目站点前要完成的工作
site 生成项目的站点文件
post-site 在生成项目站点后要完成的工作
site-deploy 发布生成的站点到服务器上
5.maven提供的一些插件
6.pox.xml解析:
设置依赖是否可选
<optional>
排除依赖传递列表
<exclusions> <exclusion>
依赖管理
<dependencies> <dependency>
插件
<build> <plugins> <plugin>
子模块继承父模块
<parent>
模块
<modules> <module>
依赖范围: --参数(compile(默认)\provided(编译、测试有效)\runtime(测试、运行)\test(测试)\system(编译、测试、可移植差)\import(导入的范围,只使用在dependencyManagement中,表示从其他的pom中导入dependency配置))
<scope>
依赖传递 :
依赖冲突:
原则:
短路优先,
先声明先优先(路径长度一样)
7.聚合和继承
聚合(modules module标签)
继承
举个例子:
--父类pom:
<properties>
<junit.version>4.0.0</junit.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<dependencies>
</dependencyManagement>
--子类pom:
<parent>
父pom坐标
</parent>
8.maven使用Jetty 和 tomcat服务运行web项目
相关文章推荐
- MySQL Study之--MySQL schema_information数据库
- 推荐Eclipse插件:Eclipse Color Theme
- linux Centos iptables 8080
- Linux下配置MySQL需要注意的几点
- C#中流,字节,字符,字符串
- #笔记#圣思园 JavaWeb 第53讲——function对象、工厂方式、构造函数方式、原型方式定义对象
- JavaScript中对象深复制
- C++宽字符串转字符串
- 在Ubuntu上安装监控rstatd
- 下载和安装和使用CocoaPods
- 实现的效果:EditText提示文本字体大小和输入文本字体大小不同
- FreeRTOS 特性简介
- Spring实例学习
- 【从零开始学NGUI 】 (七)Atlas制作
- MyEclipse常用快捷键
- unity 之2D游戏简单操作
- go语言使用redis —— redigo
- 基本技能项目猿妻子
- Win10升级10240失败卡在安装驱动怎么办?
- 开门人和关门人