Sin*_*son 10 java integration-testing build-process maven-2 jetty
我正在尝试为生成war文件的Maven项目设置集成测试.(如此处所见http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin/.)但是我的war文件需要在类路径上有一堆.properties文件,我不想捆绑在战争中.
有没有办法(最好是通过插件配置)将文件夹添加到jetty使用的类路径中?
我用Google搜索并发现了http://markmail.org/message/awtqrgxxttra3uxx但据我所知,这根本不起作用.找不到.properties文件.
Pas*_*ent 21
这应该可以使用webAppConfig配置元素(以下从该线程获取的示例):
<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>
Run Code Online (Sandbox Code Playgroud)
Gar*_*owe 16
如果您发现上述解决方案不适合您,请考虑将测试类路径包含在Jetty配置中.
<configuration>
<useTestClasspath>true</useTestClasspath>
...
</configuration>
Run Code Online (Sandbox Code Playgroud)
然后,这将允许您将所有方式的资源/类放在测试类路径上,并让它们对Jetty服务器可见,而不会让它们进入生产代码.
| 归档时间: |
|
| 查看次数: |
19306 次 |
| 最近记录: |