Reputation: 159
I have this project structure where I have a parent pom which include let's say moduleA, moduleB and moduleTest.
moduleA and moduleB each produces a war, let's say warA and warB.
I use the maven dependency plugin to copy warA and warB into moduleTest. I then want to use the maven tomcat plugin to start the war.
Unfortunately, I have these 2 dilemma: if I declare moduleTest with a package tag of war, then the tomcat plugin looks for a file named warTest to start tomcat, even if I explicitly point the path of the webapp to warA or warB. I end up getting a build failure saying cannot find war file
if I declare moduleTest with a package tag of jar, then the tomcat plugin still looks for warTest, but doesn't see it, and endup logging, skipping non war project.
I have read that it is possible to trick maven war plugin to not produce a war for the module, hence this should force tomcat to pick up any war I tell it to pick up but I have not been able to make it work.
Has anyone had to do this before?
Answer: I ended using the jetty maven plugin from morbay and I can now pick any war file. But when I try to execute the run goal I get the following error:
INFO: FrameworkServlet 'spring': initialization completed in 4017 ms
2012-05-18 11:42:57.499:INFO::Started [email protected]:8180
2012-05-18 11:42:57.500:INFO::Started [email protected]:8380
[INFO] Started Jetty Server
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 45.296s
[INFO] Finished at: Fri May 18 11:42:57 PDT 2012
[INFO] Final Memory: 32M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.mortbay.jetty:jetty-maven-plugin:7.1.3.v20100526:run
(start- container) on project functional-test: Failure: Permission denied -> [Help 1]
[ERROR]
Anyone has any idea it gets the permisson denied? I use connector to set the port number for each war.
Upvotes: 1
Views: 1705
Reputation: 31795
You can use tomcat:deploy-only goal and specify paths to your war files in the warFile configuration parameter.
Upvotes: 3