使用 Nexus 搭建Maven 仓库

Coding Alan 4年前 (2019-10-29) 6939次浏览 0个评论 扫描二维码

Nexus可通过源码等方式进行安装,最简单的方式是通过 Docker 创建同时使用 Docker Volume 进行持久化数据存储,以下使用指定的目录进行创建:

稍等片该在浏览器中访问访问 http://your.ip.addr:8081进行访问即可:

初始化界面:

使用 Nexus 搭建Maven 仓库

查看初始化密码:

点击欢迎页面的 Sign in 输入默认用户名 admin以及刚刚获取到的初始密码登录并按步骤设置密码

Nginx 配置示例

常见问题

1、Return code is: 400, ReasonPhrase: Repository does not allow updating assets: maven-releases.

产生这一问题的原因是不允许同版本重复部署,解决方法有:

  • 进入录Nexus管理界面–>小齿轮图标–>Repository–>Repositories–>maven-releases,Hosted下方请选择‘Allow redeploy’
  • 更推荐的方法是更改本地的版本号,而不是使用相同版本号打包至 Maven

2、Error occurred while executing a write operation to database ‘component’ due to limited free space on the disk (3610 MB). The database is now working in read-only mode. Please close the database (or stop OrientDB), make room on your hard drive and then reopen the database. The minimal required space is 4096 MB. Required space is now set to 4096MB (you can change it by setting parameter storage.diskCache.diskFreeSpaceLimit) . DB name=”component”. -> [Help 1]

这一问题是由于默认要求在写入时要有4GB 的空闲空间,只需修改配置文件即可,位于安装目录下的bin/nexus.vmoptions文件中,由于上面使用的是 Docker安装,Alan 暂未深入研究如何将配置文件挂载到本机中,临时解决的方案是

 

 

 

喜欢 (0)
[]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址