将类路径添加到在maven集成测试中运行的jetty [英] Adding classpath to jetty running in maven integration-test
问题描述
我正在尝试为生成war文件的Maven项目设置集成测试。 (如下所示 http://docs.codehaus.org/display/JETTY/ Maven + Jetty + Plugin / 。)但是我的war文件需要在类路径上有一堆.properties文件,我不想在战争中捆绑。
I'm trying to set up integration tests for a Maven project that produces a war file. (As seen here http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin/.) However I the war file requires a bunch of .properties files on the classpath, that I don't want to bundle in the war.
是否有办法(最好通过插件配置)将文件夹添加到jetty使用的类路径中?
Is there a way (preferably through plugin configuration) to add a folder to the classpath used by jetty?
我用Google搜索并找到了 http://markmail.org / message / awtqrgxxttra3uxx 但据我所知,这根本不起作用。找不到.properties文件。
I Googled this and found http://markmail.org/message/awtqrgxxttra3uxx but this, as far as I can tell, does not actually work at all. The .properties files are not found.
推荐答案
这应该可以使用 webAppConfig
配置元素(以下示例来自此主题):
This should be possible using the webAppConfig
configuration element (sample below taken from 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>
这篇关于将类路径添加到在maven集成测试中运行的jetty的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!