上传jar包到nexus

如果需要, 配置好认证信息

  • 在maven安装路径下的 $MAVEN_HOME/conf/settings.xml 文件中, 节点配置认证信息; 其中-DrepositoryId 后面的值进行匹配
<servers>
...
    <server> 
        <id>2rd_repo_idid>
        <username>user_nameusername>
        <password>pass_wordpassword>
    server>
...
<servers>

命令

mvn deploy:deploy-file -DgroupId=com.qww -DartifactId=second-part-jar -Dversion=1.0.0 -Dpackaging=jar -Dfile=second-part-jar-1.0.0.jar -Durl=http://xxx.xx.xx.xx:port/repository/2rdParty/ -DrepositoryId=2rd_repo_id

# ----参数说明 ---
# -Dfile:本地jar文件路径
# -Durl:远程仓库url
# -DrepositoryId:仓库id,对应节点值
# (如果提示401,认证失败,则检查: user_name 是否有权限; repositoryId 与 . 是否对应)

你可能感兴趣的:(java,jar,java,服务器)