如何配置maven或eclipse以便在版本中使用RELEASE常数? [英] How to configure maven or eclipse in order to use the RELEASE constant within versions?

查看:392
本文介绍了如何配置maven或eclipse以便在版本中使用RELEASE常数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们所有的项目都是使用maven构建的。
我们集中了一些超级pom中的一些主要配置。



为了始终拥有这个超级pom的更新版本(而不必修改版本),我们使用以下语法:

 < parent> 
< groupId> my.organization< / groupId>
< artifactId> superPom< / artifactId>
< version> RELEASE< / version>
< / parent>

问题是Maven Eclipse插件(m2e)不理解这个语法(RELEASE常量是未解决)。
所以,我们的Eclipse用户不能使用内置的编译。



你建议如何克服这个问题?



顺便说一下,我们从maven的角度考虑了几个选项(),但是version.RELEASE对于每个人都是最简单的(除了那些使用Eclipse的人)。



编辑:
我们的项目源分为多个SVN存储库。
这个超级pom是一个独立的项目。它通过我们的Nexus服务器检索。

解决方案

您正在尝试错误的方向。 在maven中发布的是一个特定的版本,如1.0.0 和它表示您具有该工件的定义状态。在你的情况下,你的超级pom有一个特定的状态。如果您正在尝试定义RELEASE的版本,那么您说我的发行版总是一样的,但是真的是不正确的。



通常这样一个超级pom会改变在这段时间让我们说今天你已经定义了一些特定的依赖版本(dependencyManagemet)。明天你改变这些定义。现在,在今天已经完成的构建中使用了超级pom的1.000.000 $问题?好的,在这个简单的情况下,你可以回答这个问题,但如果你昨天改变了超级pom,你无法准确回答这个问题。



此外,如果你尝试重新创建上周我们说的一件神器,你不能说在这个特定的时间使用了超级pom的确切状态,因为你没有任何指示,让你有机会看到它。



这就是为什么你需要真正的版本,如1.0.0或1.1.0等。



我可以强烈推荐使用真正的版本,如1.0.0等等,但不是像RELEASE这样的东西,它将会在它的corrdinate组,工件和版本的Maven系统中爬行。


All our projects are built using maven. we have centralized some of our main configuration within a super pom.

In order to always have an update version of this super pom (without having to modify the version), we have used the following syntax :

<parent>
    <groupId>my.organization</groupId>
    <artifactId>superPom</artifactId>
    <version>RELEASE</version>
</parent>

The problem is that Maven Eclipse plugin (m2e) doesn't understand this syntax (the RELEASE constant is not resolved). So, our Eclipse users can't use built-in compilation.

What do you suggest to overcome this problem ?

By the way, we have tried several options from a maven point of view (especially those described here), but the version.RELEASE is the easiest for everybody (except those who are using Eclipse).

EDIT: Our projects sources are split within multiple SVN repositories. This super pom is an independent project. It is retrieved through our Nexus server.

解决方案

You are trying to go into the wrong direction. A release in maven is a particular version like 1.0.0 and it indicates that you have a defined state of that artifact. In your case you super pom has a particular state. If you are trying to define the version to "RELEASE" you are saying my release is always the same but in reallity it's not true.

Usually such a super pom will change over the time lets say today you have defined some particular dependency versions in it (dependencyManagemet). And tomorrow you change those definition. Now the 1.000.000$ questions which state of the super pom is used in a build which has been done today? Ok in that simple scenario you can answer the question but if you have changed the super pom sometime yesterday you can't answer the question accurately.

Furthermore if you try to recreate an artifact of let's say last week you can't say which exact state of super pom has been used at that particular time cause you have no indicator which gives you the chance to see it.

And that's the reason why you need real versions like 1.0.0 or 1.1.0 etc.

I can strongly recomment to use real versions like 1.0.0 etc. but NOT things like "RELEASE" that will creep in the Maven system with its corrdinate group, artifact and version.

这篇关于如何配置maven或eclipse以便在版本中使用RELEASE常数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆