使用nexus作为maven私有中央仓库,启动出错

最近将项目从ant迁移到maven

并且使用Nexus建立一个私有的中央仓库(网上有很多相关的资料)

在启动nexus的时候报错启动失败,且部分错误信息非nexus打印

错误信息:

********* simple selection *********  ********* selection by list *********
-A all processes                      -C by command name
-N negate selection                   -G by real group ID (supports names)
-a all w/ tty except session leaders  -U by real user ID (supports names)
-d all except session leaders         -g by session OR by effective group name
-e all processes                      -p by process ID
T  all processes on this terminal     -s processes in the sessions given
a  all w/ tty, including other users  -t by tty
g  OBSOLETE -- DO NOT USE             -u by effective user ID (supports names)
r  only running processes             U  processes for specified users
x  processes w/o controlling ttys     t  by tty
*********** output format **********  *********** long options ***********
-o,o user-defined  -f full            --Group --User --pid --cols --ppid
-j,j job control   s  signal          --group --user --sid --rows --info
-O,O preloaded -o  v  virtual memory  --cumulative --format --deselect
-l,l long          u  user-oriented   --sort --tty --forest --version
-F   extra full    X  registers       --heading --no-heading --context
                    ********* misc options *********
-V,V  show version      L  list format codes  f  ASCII art forest
-m,m,-L,-T,H  threads   S  children in sum    -y change -l format
-M,Z  security data     c  true command name  -c scheduling class
-w,w  wide output       n  numeric WCHAN,UID  -H process hierarchy

这是PS命令的提示信息,于是找到nexus启动脚本中使用ps命令的地方,最终发现错误语句为

pidtest=`$PSEXE -p $pid -o args | grep "wrapper.pidfile" | tail -1`

此错误在sentOS上发生,但在ubuntu中能通过运行,估计有可能是和centOS版本太旧有关

因无法在短时间内升级系统版本,所以修改了语句:

pidtest=`$PSEXE -p $pid wwwwwwwwwwwwwww|awk '{for(i=5;i<=NF;++i){printf $i" "}printf "\n"}' | grep "wrapper.pidfile" | tail -1`

把原来-o args的地方替换为awk输出command命令,n个w是输出PS命令的完整信息

再次运行通过




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要配置Maven私有仓库,可以使用Sonatype Nexus 3作为Maven仓库管理器。 以下是配置Nexus 3作为Maven私有仓库的步骤: 1. 安装Nexus 3 可以从Sonatype官网下载Nexus 3,然后按照说明进行安装和配置。 2. 创建Maven仓库Nexus 3中创建Maven仓库,可以通过以下步骤完成: - 登录到Nexus 3的Web界面,并进入“Repositories”页面。 - 点击“Create Repository”按钮,并选择“Maven(hosted)”类型。 - 输入仓库的名称和URL,并选择存储位置等配置信息。 - 点击“Create Repository”按钮,完成仓库创建。 3. 配置MavenMaven的settings.xml文件中配置Nexus 3作为私有仓库,可以通过以下步骤完成: - 打开Maven的settings.xml文件,一般位于${user.home}/.m2/目录下。 - 在<settings>标签内添加如下配置: ``` <mirrors> <mirror> <id>nexus</id> <mirrorOf>*</mirrorOf> <url>http://nexus3.example.com/repository/maven-releases/</url> </mirror> </mirrors> ``` 其中,nexus3.example.com/repository/maven-releases/是Nexus 3仓库的URL。 4. 发布和使用Maven包 在使用Nexus 3作为Maven私有仓库时,可以通过以下步骤发布和使用Maven包: - 在项目的pom.xml文件中配置Nexus 3仓库的URL等信息。 - 使用Maven命令发布项目的Maven包到Nexus 3仓库中。 - 在其他项目的pom.xml文件中添加Nexus 3仓库的URL,然后使用Maven命令从Nexus 3仓库中获取依赖。 以上是配置Nexus 3作为Maven私有仓库的基本步骤,具体操作可以根据实际情况进行调整。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值