java - 如何配置 m2e eclipse 插件以支持父版本范围?

标签 java eclipse maven m2e

自从 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 编辑器中显示此错误消息:

无法从/到 nexus-releases (http://nexus.proxy/content/groups/public/) 传输 Artifact groupId:artifactId:pom:[1.0,1.1):索引 82 处路径中存在非法字符:http://nexus.proxy/content/groups/public/groupId/artifactId/[1.0,1.1)/artifactId-[1.0,1.1).pom和 'parent.relativePath' 指向错误的本地 POM

它在使用 Run as... > Maven install 运行时有效,请参阅下面的日志片段:

[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? 相关

最佳答案

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

M2E 的 Bugzilla #445883 (重复#438441)

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

关于java - 如何配置 m2e eclipse 插件以支持父版本范围?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25969320/

相关文章:

Java Swing 如何重置 JTextArea

Android - <include layout=.../> 返回错误

java - 为什么 Eclipse 不断地在我的工作区中重建项目?

android - android studio和android SDK bundle 的eclipse版本有什么区别

maven - Sonatype Nexus的Grails Release插件maven-deploy命令失败401错误

java - Criteriabuilder 在两列上相等

java - 检测在多进程应用程序的主进程上运行的应用程序类

java - Maven配置: pass file inside a classpath jar as an argument

Java对象——避免重复代码

gradle build 中的 Android Studio Endpoints 和 peer not authenticated 错误