2014-09-22 63 views
1

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

编辑1:(2014年9月29日9点50分@ AEST)

方案:导入具有以下父定义一个行家项目与M2E插件蚀(该项目是不是一个模块其父)的

<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... > 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?

+0

您能否让您的问题更清楚?你给了很多链接,更具体,以便每个人都可以发布很好的答案。 – 2014-09-22 11:10:53

+0

你去@SanjayaPandey :) – 2014-09-22 23:51:41

回答

0

应固定在M2E 1.6.x版本

的Bugzilla为M2E #445883(重复的#438441

作为一种变通方法,使用最新或RELEASE如家长pom的版本应该工作。