问题描述
我在Eclipse中使用m2eclipse Maven支持资源过滤问题。似乎过滤只发生在已经更改的资源上。这是根本的缺陷,因为如果我有一个引用属性的文件(例如$ {my.property}),如果属性的值更改,则只有在引用文件也被修改时,才会执行过滤 - 如果我只更改属性值(在我的pom.xml中),过滤不适用于引用它的文件。
所以,如果我对我的某个属性进行更改pom文件,过滤不被应用,但是如果我然后转到引用该属性的文件(例如一个Spring配置文件),然后编辑并保存,则应用过滤。
我读过某个地方:
m2eclipse跳过过滤如果在增量版本中没有资源更改
我正在使用m2eclipse 0.10.x
有其他人遇到这个吗?
谢谢,
Andrew
是的, a href =http://markmail.org/message/73 3lqtw5moa4cim4rel =noreferrer>这个冗长的讨论(主题不完全是关于资源过滤,但提到了当前的行为):
我的理解是,这是一个设计选择(请参阅Eugene的):
有人担心资源过滤可能会影响IDE中的性能,并不总是需要(例如,过滤仅用于将一些关于构建的东西存储到结果jar中)
因此,在您的POM更改后,您应该更新项目配置:右键单击,然后 Maven>更新项目配置(这将触发进程资源
)。
据我所知,这仍然是当前状态。有关的许多问题,但也可以查看如果你能找到一个类似的。
I've having problems with resource filtering using m2eclipse Maven support in Eclipse. It seems that filtering only takes place on resources that have changed. This is fundamentally flawed because, if I have a file that references properties (e.g. ${my.property}, if the value of the property changes, the filtering will only be performed if the referencing file is also modified - if I only change the property value (in my pom.xml), the filtering is not applied to the files that that reference it.
So, if I make a change to a property in my pom file, the filtering is not applied. However, if I then go to the file that references that property (e.g. a Spring config file) then edit and save it, the filtering is applied.
I did read somewhere that:
"m2eclipse skips filtering if there were no resource changes during incremental build"
I'm using m2eclipse 0.10.x
Has anyone else come across this?
Thanks,
Andrew
Yes, this is mentioned in this lengthy discussion (the topic is not exactly about resources filtering but the current behavior is mentioned):
And my understanding is that this was a design choice (see the last message from Eugene):
So, after a change in your POM, you should update the project configuration: right-click on your project then Maven > Update Project Configuration (and this will trigger process-resources
).
To my knowledge, this is still the current status. There are many issues about resource filtering though, maybe check to see if you can find an similar one.
这篇关于m2eclipse资源过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!