Linux Maven的安装

1.首先到Maven官网下载安装文件,目前最新版本为3.0.3,下载文件为apache-maven-3.0.3-bin.tar.gz,下载可以使用wget命令;

2.进入下载文件夹,找到下载的文件,运行如下命令解压
tar -xvf apache-maven-2.2.1-bin.tar.gz

解压后的文件夹名为apache-maven-3.0.3

3.使用mv命令将apache-maven-3.0.3文件夹拷贝到自己指定的文件夹,比如/usr/local/下
mv -rf apache-maven-3.0.3 /usr/local/

4.配置环境变量,编辑/etc/profile文件,添加如下代码
MAVEN_HOME=/usr/local/apache-maven-3.0.3
export MAVEN_HOME
export PATH=${PATH}:${MAVEN_HOME}/bin

5.保存文件,并运行如下命令使环境变量生效
source /etc/profile

6.在控制台输入如下命令,如果能看到Maven相关版本信息,则说明Maven已经安装成功
mvn -v

[@more@]

ERROR:

  • Failed to create assembly: Failed to retrieve OS enviroment variales. Reason: cannot run program "env" : java.io.IOException: error=24, Too many open file

One day some builds in your enterprise start to fail with “Too many open files”. Not all of them and it is hard to reproduce. If let untreated, your buildchain will become unstable. That means more time, more errors unrelated to code. In the end, you will face “too many file handles” problem everywhere, nothing will build… Better idea would be to understand the problem and fix it as soon as possible.

Maven2 really holds many file handles. How to know, that’s your case? You can profile the build as described above. If the average number of open file handles remains similar, that’s not a memory leak or code problem, that’s just a feature of maven.

[?] How many file handles can maven hold?
In our really big reactor project it was 300-900 open file handles with average maybe around 450. Rarely, number spiked over 900 handles.

One popular case is during the exec of external program.

add to /etc/security/limits.conf following lines

* soft nofile 2048
* hard nofile 4096

Restart computer

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25969737/viewspace-1051809/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/25969737/viewspace-1051809/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值