maven 配置远程仓库服务器密码
如果maven仓库被指定为私库或者有权限设定的话,一般来说是可以下载jar包的。但是发布jar包就有问题了
如果maven仓库设置了权限系统,用户不仅需要具有远程仓库的权限,还需要在setting.xml中配置用户名密码,以获取授权
eg:
id是发布管理的服务器配置id,该id配置在distributionManagement中。关于distributionManagement的配置可以参考随笔中的相关文章(还没写呢)。
username是用户名
password是密码,并且可以添加描述信息,比如创建时间、过期时间等,此时密码要放在{}中
关于distributionManagement,可配置如下:
<distributionManagement> <snapshotRepository> <id>my.server</id> <name>Internal Repository</name> <url>http://repo.xxx.net/content/repositories/contract/</url> </snapshotRepository> </distributionManagement>
邮