maven继承parent,relativePath warn信息的解决办法

发布时间:2017-5-28 20:19:25 编辑:www.fx114.net 分享查询网我要评论
本篇文章主要介绍了"maven继承parent,relativePath warn信息的解决办法 ",主要涉及到maven继承parent,relativePath warn信息的解决办法 方面的内容,对于maven继承parent,relativePath warn信息的解决办法 感兴趣的同学可以参考一下。

往下看之前一定要先看

%MAVEN_HOME%/conf/settings.xml

配置文件的是否更改了,是否配置正确

<mirror>       
      <id>nexus</id>        
      <url>http://maven.xxxxxx.com/nexus/content/groups/public/</url>       
      <mirrorOf>central</mirrorOf>
    </mirror>
    <!--
    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
    </mirror>
    -->

转自:http://blog.sina.com.cn/s/blog_56d8ea9001013fz9.html
比如:
<parent>
<groupId>com.tenace</groupId>
<artifactId>tenace</artifactId>
<version>2.0.1</version>
<relativePath></relativePath> //刚开始无此句
</parent>
<groupId>com.joinspider</groupId>
<artifactId>spiderengine</artifactId>
<version>2.6.0-SNAPSHOT</version>

tenace作为pom项目已经发布至repo,如果没有指定relativapath。则mvn -X -e clean package可以看到如下警告信息:
[WARNING]
[WARNING] Some problems were encountered while building the effective model for
com.joinspider:spiderengine:jar:2.6.0-SNAPSHOT
[WARNING] 'parent.relativePath' points at com.joinspider:joinspider instead of c
om.tenace:tenace, please verify your project structure @ line 4, column 10
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten t
he stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support buildin
g such malformed projects.

解决办法则是加上<relativePath></relativePath>。
说明见链接:http://maven.apache.org/ref/3.0.3/maven-model/maven.html#class_parent

说明如下:
The relative path of the parent pom.xml file within the check out. If not specified, it defaults to ../pom.xml. Maven looks for the parent POM first in this location on the filesystem, then the local repository, and lastly in the remote repo. relativePath allows you to select a different location, for example when your structure is flat, or deeper without an intermediate parent POM. However, the group ID, artifact ID and version are still required, and must match the file in the location given or it will revert to the repository for the POM. This feature is only for enhancing the development in a local checkout of that project. Set the value to an empty string in case you want to disable the feature and always resolve the parent POM from the repositories.
Default value is: ../pom.xml.

上一篇:INI配置文件分析小例子
下一篇:Atitit onvif 协议截图 getSnapshotUri 使用java

相关文章

相关评论

本站评论功能暂时取消,后续此功能例行通知。

一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用本站制作、复制和传播不法有害信息!

二、互相尊重,对自己的言论和行为负责。