Maven in 5 Minutes

安装:java环境

[color=red]额外配置[/color]:
You can specify your user configuration in [color=red]${user.home}/.m2/settings.xml[/color]. A full reference to the configuration file is available. This section will show how to make some common configurations. Note that the file is not required - defaults will be used if it is not found.

修改本地Repo的目录:
The location of your local repository can be changed in your user configuration. The default value is ${user.home}/.m2/repository/.

<settings>
...
<localRepository>/path/to/local/repo/</localRepository>
...
</settings>

Note: [color=red]The local repository must be an absolute path.[/color]
[color=red]配置代理[/color]:
[color=red]配置组件的并发现在数[/color]:
By default, Maven 2.1.0+ will download up to 5 artifacts (from different groups) at once. To change the size of the thread pool, start Maven using -Dmaven.artifact.threads. For example, to only download single artifacts at a time:

mvn -Dmaven.artifact.threads=1 clean install

You may wish to set this option permanently, in which case you can use the MAVEN_OPTS environment variable. For example:

export MAVEN_OPTS=-Dmaven.artifact.threads=3
[color=red]使用镜像Repo[/color]:
<settings>
...
<mirrors>
<mirror>
<id>UK</id>
<name>UK Central</name>
<url>http://uk.maven.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
...
</settings>

Maven1下好像不起作用,有时间再试了
控制Maven的日志级别
maven -[color=red]E[/color] jar([color=red]注意大小写[/color])
如果你想控制Maven的日志级别,你可以使用下面三个命令行选项:
-e, --errors 产生执行错误相关消息
-X, --debug 产生执行调试信息
-q, --quiet 仅仅显示错误
只有出现错误或问题,-q 选项才打印一条消息。-X 选项会打印大量的调试日志消息,这个选项主要被Maven开发者和Maven插件开发者用来诊断在开发过程中碰到的Maven代码问题。如果你想诊断依赖或路径问题,-X 选项也非常有用。如果你是Maven开发者,或者你需要诊断Maven插件的一个错误,那么-e选项就会派上用场。如果你想报告Maven或Maven插件的一个未预料到的问题,你应该传递-X 和 -e命令行选项。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值