在 Maven 构建期间将文件添加到 jar

发布于 2024-10-01 13:48:53 字数 114 浏览 0 评论 0原文

我有一个 xslt,想在执行 Maven 构建时将其添加到我的 jar 文件中。我阅读了文档,您可以在资源文件夹中添加内容,它会被拾取,但是如果我希望它显示在不同的文件夹中怎么办 - 我如何让它在 jar 中出现?

I have an xslt that I want to add to my jar file when I do the maven build. I read int he documentation you can add stuff in the resources folder, and it will get picked up, but what if I want it to show up in a different folder - how do I make it go there in the jar?

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

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

发布评论

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

评论(1

一身骄傲 2024-10-08 13:48:53

如果它是一个 JAR,只需将其添加到 src/main/resources 中,复制您想要出现在 JAR 中的文件夹结构(JAR 的类路径根是它的第一级,因此很容易) 。

对于 WAR 或其他包类型,方法非常不同

If it's a JAR just add it in src/main/resources replicating the folder structure you want to be present in the JAR (the classpath root for a JAR is the very first level on it so it's easy).

In case of a WAR or other package types the method is very different

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