赞
踩
项目基于一个父项目(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账号密码,发布成功
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。