m2eclipse资源过滤 [英] m2eclipse resource filtering

查看:153
本文介绍了m2eclipse资源过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Eclipse中使用m2eclipse Maven支持资源过滤问题。似乎过滤只发生在已经更改的资源上。这是根本的缺陷,因为如果我有一个引用属性的文件(例如$ {my.property}),如果属性的值更改,则只有在引用文件也被修改时,才会执行过滤 - 如果我只更改属性值(在我的pom.xml中),过滤不适用于引用它的文件。



所以,如果我对我的某个属性进行更改pom文件,过滤不被应用,但是如果我然后转到引用该属性的文件(例如一个Spring配置文件),然后编辑并保存,则应用过滤。



我读过某个地方:



m2eclipse跳过过滤如果在增量版本中没有资源更改



我正在使用m2eclipse 0.10.x



有其他人遇到这个吗?



谢谢,



Andrew

解决方案

是的, a href =http://markmail.org/message/73 3lqtw5moa4cim4rel =noreferrer>这个冗长的讨论(主题不完全是关于资源过滤,但提到了当前的行为):


当资源过滤启用时,m2eclipse将运行指定的目标(默认情况下为进程资源资源:testResources),作为Eclipse构建的一部分,将资源过滤到项目的输出文件夹(target / classes或target-eclipse / classes) 。 m2eclipse跳过过滤,如果增量生成期间没有资源更改


我的理解是,这是一个设计选择(请参阅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):

When resource filtering is enabled, m2eclipse will run specified goals ("process-resources resources:testResources" by default) to filter resources into project's output folder (target/classes or target-eclipse/classes) as part of Eclipse build. m2eclipse skips filtering if there were no resource changes during incremental build

And my understanding is that this was a design choice (see the last message from Eugene):

There was concern that resource filtering may affect performance in the IDE and not always needed (e.g. when filtering is only used to store some stuff about build into the result jar)

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资源过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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