maven 3 无法读取工件描述符
我升级到使用嵌入式 maven 3 的 netbeans 7。我有一个包含很多模块和包含其他模块的模块的项目。我的其他不依赖于内部项目的子模块可以在相同的配置下正常工作。在这种情况下, spring-hibernate 依赖于作为子模块之一的域并且失败。
我的主项目有这样的东西
<modelVersion>4.0.0</modelVersion>
<artifactId>spring</artifactId>
<packaging>pom</packaging>
<groupId>${masterproject.groupId}</groupId>
<version>${masterproject.version}</version>
我的子模块有以下定义
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>spring</artifactId>
<groupId>${masterproject.groupId}</groupId>
<version>${masterproject.version}</version>
</parent>
<artifactId>spring-hibernate</artifactId>
<packaging>pom</packaging>
<dependency>
<groupId>${masterproject.groupId}</groupId>
<artifactId>domain</artifactId>
</dependency>
我正在使用以下 ${masterproject.groupId}, ${masterproject.version} 因为我不想在所有子模块中放置静态值,因为每个子模块都包含一个父母。不确定这是否是问题的原因。
所有这些在 maven 2 中都可以正常工作。但是在 maven 3 中我收到以下错误消息
Failed to read artifact descriptor for com.merc:domain:jar:1.0-SNAPSHOT: Failure to find ${masterproject.groupId}:MavenMasterProject:pom:${masterproject.version} in http://repository.springsource.com/maven/bundles/release was cached in the local repository, resolution will not be reattempted until the update interval of com.springsource.repository.bundles.release has elapsed or updates are forced -> [Help 1]
I upgrade to netbeans 7 which uses embeded maven 3. I have a project with lot of modules and modules containing other modules. My other submodules that don't depend on internal projects work fine with the same configuration. In this case, spring-hibernate depends on domain which is one of the submodules and fails.
my main project has something like this
<modelVersion>4.0.0</modelVersion>
<artifactId>spring</artifactId>
<packaging>pom</packaging>
<groupId>${masterproject.groupId}</groupId>
<version>${masterproject.version}</version>
my submodule has the following def
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>spring</artifactId>
<groupId>${masterproject.groupId}</groupId>
<version>${masterproject.version}</version>
</parent>
<artifactId>spring-hibernate</artifactId>
<packaging>pom</packaging>
<dependency>
<groupId>${masterproject.groupId}</groupId>
<artifactId>domain</artifactId>
</dependency>
I am using the following ${masterproject.groupId}, ${masterproject.version} because I don't want to put static value in all the submodules as each one contains a parent. Not sure if this is the cause of the problem.
All of this works fine with maven 2. But with maven 3 I get the following error msg
Failed to read artifact descriptor for com.merc:domain:jar:1.0-SNAPSHOT: Failure to find ${masterproject.groupId}:MavenMasterProject:pom:${masterproject.version} in http://repository.springsource.com/maven/bundles/release was cached in the local repository, resolution will not be reattempted until the update interval of com.springsource.repository.bundles.release has elapsed or updates are forced -> [Help 1]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我在 Eclipse 中遇到了这个问题,并修复了它(即使我的命令行构建有效)
mvn 命令行中重新运行更新依赖项,但我的 IDE 没有,当我在 IDE 中运行它时,两者都工作了......非常奇怪。
作为另一种选择,
重新启动 eclipse 似乎也有帮助
I had this in eclipse and did this which fixed it(even though my command line build worked)
mvn command line worked while my IDE didn't, once I ran it in my IDE both worked..very weird.
As another option,
restarting eclipse seemed to help as well
一种可能性是您在
profiles.xml
中指定masterproject.groupId
和masterproject.version
的值。如果是这样,则 maven3 中不再支持。One possibility is you are specifying the values for
masterproject.groupId
andmasterproject.version
inprofiles.xml
. If so, it is no longer supported in maven3.该消息,尤其是
Failure to find
部分,意味着您缺少pom.xml
文件中相应属性的描述:并且要小心:此类错误可能会引发许多错误相关错误!
That message, especially that
Failure to find
part, means that you lack the description of the appropriate property in thepom.xml
file:And be careful: such error could evoke many dependent errors!
我有同样的问题,maven 不喜欢有一个非常量(即属性)父版本。
尝试将您的父元素更改为:
显然,它不必是
1.0-SNAPSHOT
它只需是某个静态版本即可。希望这有帮助。
I had the same issue, maven does not like having a non-constant (i.e. a property) parent version.
Try changing your parent element to:
Obviously, it doesn't have to be
1.0-SNAPSHOT
it just has to be some static version.Hope this helps.