maven 3 无法读取工件描述符

发布于 2024-10-18 15:13:59 字数 1574 浏览 2 评论 0原文

我升级到使用嵌入式 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

做个少女永远怀春 2024-10-25 15:13:59

我在 Eclipse 中遇到了这个问题,并修复了它(即使我的命令行构建有效)

  1. 删除了 .m2/repostiory/.... 中的目录,
  2. 在我的 IDE

mvn 命令行中重新运行更新依赖项,但我的 IDE 没有,当我在 IDE 中运行它时,两者都工作了......非常奇怪。

作为另一种选择,
重新启动 eclipse 似乎也有帮助

I had this in eclipse and did this which fixed it(even though my command line build worked)

  1. delete the directory in .m2/repostiory/....
  2. rerun update dependencies in my IDE

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

牵强ㄟ 2024-10-25 15:13:59

一种可能性是您在 profiles.xml 中指定 masterproject.groupIdmasterproject.version 的值。如果是这样,则 maven3 中不再支持

One possibility is you are specifying the values for masterproject.groupId and masterproject.version in profiles.xml. If so, it is no longer supported in maven3.

暖伴 2024-10-25 15:13:59

该消息,尤其是 Failure to find 部分,意味着您缺少 pom.xml 文件中相应属性的描述:

<properties>
    <masterproject.version>the.appropriate.version</masterproject.version>
</properties>

并且要小心:此类错误可能会引发许多错误相关错误!

That message, especially that Failure to find part, means that you lack the description of the appropriate property in the pom.xml file:

<properties>
    <masterproject.version>the.appropriate.version</masterproject.version>
</properties>

And be careful: such error could evoke many dependent errors!

神也荒唐 2024-10-25 15:13:59

我有同样的问题,maven 不喜欢有一个非常量(即属性)父版本。

尝试将您的父元素更改为:

<parent>
    <artifactId>spring</artifactId>
    <groupId>${masterproject.groupId}</groupId>
    <version>1.0-SNAPSHOT</version>
</parent>

显然,它不必是 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:

<parent>
    <artifactId>spring</artifactId>
    <groupId>${masterproject.groupId}</groupId>
    <version>1.0-SNAPSHOT</version>
</parent>

Obviously, it doesn't have to be 1.0-SNAPSHOT it just has to be some static version.

Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文