【问题标题】:How to configure m2e eclipse plugin to support parent version ranges?如何配置 m2e eclipse 插件以支持父版本范围?
【发布时间】:2014-09-22 08:05:58
【问题描述】:

由于Maven 3.2.2支持定义pom的parent version with ranges,是否可以配置m2e插件来解析版本范围?怎么样?

编辑 1: (2014-09-29 @ 09:50 AEST)

场景:使用m2e插件将具有以下父定义的maven项目导入eclipse(该项目不是其父的模块)

<parent>
    <artifactId>artifactId</artifactId>
    <groupId>groupId</groupId>
    <version>[1.0,1.1)</version>
</parent>

M2E 插件无法解析版本范围,在 POM 编辑器中显示此错误消息:

Could not transfer artifact groupId:artifactId:pom:[1.0,1.1) from/to nexus-releases (http://nexus.proxy/content/groups/public/): Illegal character in path at index 82: http://nexus.proxy/content/groups/public/groupId/artifactId/[1.0,1.1)/artifactId-[1.0,1.1).pom and 'parent.relativePath' points at wrong local POM

使用Run as... &gt; Maven install运行时有效,见下面的日志sn-p:

[INFO] Scanning for projects...
[INFO] Downloading: http://nexus.proxy/content/groups/public/groupId/artifactId/maven-metadata.xml
[INFO] Downloading: http://nexus.proxy/content/groups/public/groupId/artifactId/maven-metadata.xml
[INFO] Downloading: http://nexus.proxy/content/groups/public-snapshot/groupId/artifactId/maven-metadata.xml
[INFO] Downloaded: http://nexus.proxy/content/groups/public-snapshot/groupId/artifactId/maven-metadata.xml (488 B at 0.8 KB/sec)
[INFO] Downloaded: http://nexus.proxy/content/groups/public/groupId/artifactId/maven-metadata.xml (2 KB at 2.1 KB/sec)
[INFO] Downloaded: http://nexus.proxy/content/groups/public/groupId/artifactId/maven-metadata.xml (2 KB at 2.1 KB/sec)
[INFO] Downloading: http://nexus.proxy/content/groups/public/groupId/artifactId/[1.0,1.1)/artifactId-[1.0,1.1).pom
[INFO] Downloading: http://nexus.proxy/content/groups/public/groupId/artifactId/[1.0,1.1)/artifactId-[1.0,1.1).pom

PS.:问题不在于这是否是一个好习惯,请参考Benjamin's comment 了解一些背景知识。

How to configure maven or eclipse in order to use the RELEASE constant within versions?相关

【问题讨论】:

  • 你能把你的问题说清楚一点吗?您提供了很多链接,更具体,以便每个人都可以发布好的答案。
  • 你去@SanjayaPandey :)

标签: java eclipse maven m2e


【解决方案1】:

应该在 m2e v1.6.x 上修复

M2E 的 Bugzilla #445883(与 #438441 重复)

作为一种解决方法,使用 LATEST 或 RELEASE 作为父 pom 的版本应该可以工作。

【讨论】:

    猜你喜欢
    • 2021-08-22
    • 2013-10-21
    • 1970-01-01
    • 2012-10-15
    • 2021-09-23
    • 1970-01-01
    • 1970-01-01
    • 2020-01-22
    • 1970-01-01
    相关资源
    最近更新 更多