您的位置:首页 > 大数据 > 人工智能

Maven常用参数及其说明【转:http://blog.csdn.net/wangjunjun2008/article/details/18982089】

2016-11-20 22:37 330 查看
Maven常用参数及其说明

-h,--help Display help information
-am,--also-make 构建指定模块,同时构建指定模块依赖的其他模块;
-amd,--also-make-dependents 构建指定模块,同时构建依赖于指定模块的其他模块;
-B,--batch-mode 以批处理(batch)模式运行;
-C,--strict-checksums 检查不通过,则构建失败;(严格检查)
-c,--lax-checksums 检查不通过,则警告;(宽松检查)
-D,--define <arg> Define a system property
-e,--errors 显示详细错误信息
-emp,--encrypt-master-password <arg> Encrypt master security password
-ep,--encrypt-password <arg> Encrypt server password
-f,--file <arg> 使用指定的POM文件替换当前POM文件
-fae,--fail-at-end 最后失败模式:Maven会在构建最后失败(停止)。如果Maven refactor中一个失败了,Maven会继续构建其它项目,并在构建最后报告失败。
-ff,--fail-fast 最快失败模式: 多模块构建时,遇到第一个失败的构建时停止。
-fn,--fail-never 从不失败模式:Maven从来不会为一个失败停止,也不会报告失败。
-gs,--global-settings <arg> 替换全局级别settings.xml文件(Alternate path for the global settings file)
-l,--log-file <arg> 指定输出日志文件
-N,--non-recursive 仅构建当前模块,而不构建子模块(即关闭Reactor功能)。
-nsu,--no-snapshot-updates 强制不更新SNAPSHOT(Suppress SNAPSHOT updates)
-U,--update-snapshots 强制更新releases、snapshots类型的插件或依赖库(否则maven一天只会更新一次snapshot依赖)
-o,--offline 运行offline模式,不联网进行依赖更新
-P,--activate-profiles <arg> 激活指定的profile文件列表(用逗号[,]隔开)
-pl,--projects <arg> 手动选择需要构建的项目,项目间以逗号分隔;A project can be specified by [groupId]:artifactId or by its relative path.
-q,--quiet 安静模式,只输出ERROR
-rf,--resume-from <arg> 从指定的项目(或模块)开始继续构建
-s,--settings <arg> 替换用户级别settings.xml文件(Alternate path for the user settings file)
-T,--threads <arg> Thread count, for instance 2.0C where C is core multiplied
-t,--toolchains <arg> Alternate path for the user toolchains file
-V,--show-version Display version information WITHOUT stopping build
-v,--version Display version information
-X,--debug 输出详细信息,debug模式。
-cpu,--check-plugin-updates 【废弃】,仅为了向后兼容
-npr,--no-plugin-registry 【废弃】,仅为了向后兼容
-npu,--no-plugin-updates 【废弃】,仅为了向后兼容
-up,--update-plugins 【废弃】,仅为了向后兼容

必选的Profile一般配置在settings.xml中,始终激活;
可选的Profile一般配置在pom.xml中,持续集成时,根据不同环境激活不同的Profile;
$ mvn help:active-profiles 列出当前激活的Profile
$ mvn help:all-profiles 列出当前所有的Profile

到目前为止(最新版本为3.1.1)Maven的不足:
1.无法在Profile中引用另外一个Profile,Maven不支持,从而导致代码重复;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: