gpt4 book ai didi

java - 将类路径添加到在 Maven 集成测试中运行的 jetty

转载 作者:搜寻专家 更新时间:2023-10-30 21:36:24 24 4
gpt4 key购买 nike

我正在尝试为生成 war 文件的 Maven 项目设置集成测试。 (如此处所示 http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin/ 。)但是我的 war 文件需要类路径上的一堆 .properties 文件,我不想将其捆绑在 war 中。

有没有办法(最好通过插件配置)将文件夹添加到 jetty 使用的类路径?

我用谷歌搜索并找到了 http://markmail.org/message/awtqrgxxttra3uxx但据我所知,这实际上根本不起作用。找不到 .properties 文件。

最佳答案

这应该可以使用 webAppConfig 配置元素(下面的示例取自 this thread ):

<webAppConfig>
<contextPath>/nportal</contextPath>
<!-- All I want to do here is add in the /etc/jetty/classes for runtime files. For some reason I have to also add back in the /target/classes directory -->
<extraClasspath>${basedir}/target/classes/;${basedir}/etc/jetty/classes/</extraClasspath>
</webAppConfig>

关于java - 将类路径添加到在 Maven 集成测试中运行的 jetty ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2176067/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com