开发者

Trying to run external war in integration test in Maven

I am 开发者_运维知识库trying to test a web application that relies on Solr for executing search queries. I already have the Maven Tomcat plugin which starts up the web application. During the Maven build, how can I import a war (Solr) that is external to the module and run that in Tomcat as well?

Notes: I created a Solr war package and put it in a local Maven repository. I then added the dependency to the web application project. As I've found out, without adding any other configuration, it's overlaying the Solr war on top of my web application. Not ideal.


Copy the file appache-solr*.war from solr\dist to tomcat\webapps then go to appache-tomcat\bin and Edit the file catalina.bat and apply the following patch (you can also do it manually, just adding a line)

@@ -84,7 +84,8 @@ rem $Id: catalina.bat 1040546 2010-11-30 14:47:34Z markt $ rem ---------------------------------------------------------------------------

- +rem Adding solr home path +set JAVA_OPTS=%JAVA_OPTS% -Dsolr.solr.home=c:/solr rem Suppress Terminate batch job on CTRL+C if not ""%1"" == ""run"" goto mainEntry

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜