m2eclipse资源过滤

发布于 2024-08-31 18:22:25 字数 407 浏览 8 评论 0原文

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

因此,如果我对 pom 文件中的属性进行更改,则不会应用过滤但是,如果我继续。到引用该属性的文件(例如 Spring 配置文件),然后编辑并保存它,

我确实在某处读到:

“如果增量构建期间没有资源更改,则 m2eclipse 会跳过过滤”

我正在使用 m2eclipse。 0.10.x

还有其他人遇到过这个吗?

谢谢,

安德鲁

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

郁金香雨 2024-09-07 18:22:25

是的,在这个冗长的讨论中提到了这一点(主题不完全是关于资源过滤,但当前的行为是提及):

启用资源过滤后,m2eclipse 将运行指定的目标(默认为“process-resources resources:testResources”),将资源过滤到项目的输出文件夹(target/classes 或 target-eclipse/classes)中,作为 Eclipse 构建的一部分。 如果增量构建期间没有资源更改,m2eclipse 会跳过过滤

我的理解是,这是一种设计选择(请参阅 来自尤金的最后一条消息):

有人担心资源过滤可能会影响 IDE 中的性能,并且并不总是需要(例如,当过滤仅用于将一些有关构建的内容存储到结果 jar 中时)

因此,在 POM 更改后,您应该更新项目配置: 右键单击您的项目,然后Maven >更新项目配置(这将触发流程资源)。

据我所知,这仍然是目前的状况。不过,关于 资源过滤 有很多问题,也许可以检查一下如果你能找到类似的。

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.

美男兮 2024-09-07 18:22:25

是的你是对的。

您应该在 m2eclipse 的错误跟踪器中提出问题。

Yes, you are right.

You should open an issue in m2eclipse's bug tracker.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文