当前位置:   article > 正文

Maven多模块,父项目Pom发布到Maven私服问题和打包Return code is: 401, ReasonPhrase: Unauthorized问题_maven打包父pom问题

maven打包父pom问题

项目基于一个父项目(pom依赖),多个子module进行构建的项目,发布到maven私服的时候往往会出现相互依赖的问题。通常情况下需要每个项目都单独的进行maven私服上传而不是关系性上传所有。

特别是针对父pom的上传,不能因为上次父pom依赖,而将所有的项目都上传到私服。

Jenkins构建时报

Failed to read artifact descriptor for com.dxyun.platform:einvoice-platform-protocol:jar:1.0.5: Could not find artifact com.dxyun.platform:einvoice-platform:pom:1.0 in dxhy (http://10.1.20.6:8081/nexus/content/groups/public/) -> [Help 1]

发现父pom没发布到私服,随后就对父pom进行deploy,我用的是mvn clean package deploy -Dmaven.test.skip=true -Drepository:snapshots -N命令

然后报

ailed to deploy artifacts: Could not transfer artifact com.dxyun.pla

tform:einvoice-platform:pom:1.0 from/to nexus-releases (http://10.1.20.6:8081/nexus/content/repositories/releases): Failed to transfer file: http://10.1.20.6:8081/nexus/content/repositories/releases/com/

dxyun/platform/einvoice-platform/1.0/einvoice-platform-1.0.pom. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]

。。。经过查看maven的settings.xml文件配置的

<server>

<id>user-releases</id>

<username>****</username>

<password>****</password>

</server>

随后使用mvn -X 这个命令查看当前生效的settings.xml是哪一个

$ mvn -X

Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T02:33:14+08:00)

Maven home: D:\IdeaMavenOrder\apache-maven-3.5.4

Java version: 1.8.0_25, vendor: Oracle Corporation, runtime: D:\Java\jdk1.8.0_25\jre

Default locale: zh_CN, platform encoding: GBK

OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "windows"

发现使用的是这个IdeaMavenOrder\apache-maven-3.5.4目录下的,而不是我在idea build tools-》maven下配置的文件,随后修改IdeaMavenOrder\apache-maven-3.5.4下的settings.xml账号密码,发布成功

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/396811?site
推荐阅读
相关标签
  

闽ICP备14008679号