美文网首页
Maven打包报错

Maven打包报错

作者: 李北北 | 来源:发表于2019-05-17 16:02 被阅读0次

Maven打包时候报如下错误:

D:\rep\svnRep\01.Projects\V1.3.0\myProject\myProject-web>mvn clean package
[INFO] Scanning for projects...
Downloading from xxx-down: http://maven.xxx.com.cn/nexus/content/groups/xxx-group/com/xxx/xxx-parent/1.3.0-SNAPSHOT/maven-metadata.xml
Downloading from xxx-down: http://maven.xxx.com.cn/nexus/content/groups/xxx-group/com/xxx/xxx-parent/1.3.0-SNAPSHOT/xxx-parent-1.3.0-SNAPSHOT.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.xxx.cms:myProject:1.0.0-SNAPSHOT: Could not find artifact com.xxx:xxx-parent:pom:1.3.0-SNAPSHOT in xxx-down (http://maven.xxx.com.cn/nexus/content/groups/xxx-group/) and 'parent.relativePath' points at wrong local POM @ line 4, column 13
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project com.xxx.cms:myProject:1.0.0-SNAPSHOT (D:\rep\svnRep\01.Projects\V1.3.0\myProject\myProject-web\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.xxx.cms:myProject:1.0.0-SNAPSHOT: Could not find artifact com.xxx:xxx-parent:pom:1.3.0-SNAPSHOT in xxx-down (http://maven.xxx.com.cn/nexus/content/groups/xxx-group/) and 'parent.relativePath' points at wrong local POM @ line 4, column 13 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

可以看到报错信息提示在指定Maven仓库找不到包,后来发现这个项目所用的maven仓库和别的项目不一样,实际上Maven的setting文件也是不一样的,打包的时候需要大概会默认使用settings.xml文件的配置,而如果有别的不同配置文件的话,打包命令如下即可指定maven配置文件:

mvn clean package --settings D:\soft\apache-maven-3.5.2\conf\settings_xxx.xml -DskipTests

相关文章

网友评论

      本文标题:Maven打包报错

      本文链接:https://www.haomeiwen.com/subject/misoaqtx.html