Maven对依赖项中存储的资源进行过滤 [英] Maven filtering on resources stored in dependencies

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

问题描述

是否可以对依赖项中存储的资源(例如spring文件)应用Maven筛选?

Is it possible to have maven filtering applied on resources (such as spring files) that are stored in dependencies?

我的一个依赖罐中的spring文件使用属性$ {project.artifactId}.如何对这个Spring文件应用过滤,以便可以将资源导入到本地Spring文件中?

A spring file in one of my dependent jars uses the property ${project.artifactId}. How can I apply filtering to this spring file so I can import the resource in my local spring file?

推荐答案

您可以先使用

You can unpack the jar first by using the unpack goal in the maven dependency plugin.

然后,您可以使用资源插件进行过滤.

You can then apply filtering using the resources plugin.

这篇关于Maven对依赖项中存储的资源进行过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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