Most likely, you'll need to add a folder:

src/main/webapp/WEB-INF

to your maven project and add into it your own web.xml that would contain the 
setups and stuff for your CXF servlet, your bean mappings, etc...   That 
should allow the resulting war to have the required/proper mapping to make it 
directly deployable into tomcat/jetty/etc..

Actually, if you set your "packaging" in maven pom to "war" so "mvn install" 
will generate the war, then you can run it directly using the jetty or tomcat 
maven plugins.   (mvn jetty:run)      Also, the maven eclipse plugin would 
recognize the war packaging and wire it into the eclipse runners and such.

Dan


On Tue May 5 2009 10:26:21 am Raphael F. wrote:
> Hello all,
>
> I'd like to launch my CXF based application into a web server (Tomcat
> for instance, or any other if needed) just by moving a WAR file into
> webapps directory and deploying with server's manager, so that a user
> of my app can deploy it without Maven or else dev tool. I have
> generated a WAR file from my application which I usually deploy with
> maven command (after having used "mvn install" command) :
> mvn -Pserver
>
> The "mvn war:war" command has generated a WAR file with all classes
> and libraries used, but it contains a /WEB-INF/web.xml file with
> following :
>
>     <!DOCTYPE web-app PUBLIC
>      "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>      "http://java.sun.com/dtd/web-app_2_3.dtd"; >
>
>     <web-app>
>       <display-name>Archetype Created Web Application</display-name>
>     </web-app>
>
>
> A /META-INF/MANIFEST.MF file :
>
>     Manifest-Version: 1.0
>
>     Created-By: Apache Maven
>
>     Built-By: rflores
>
>     Build-Jdk: 1.6.0_0
>
>
>
>
> A /META-INF/application.xml file :
>
>     <?xml version="1.0" encoding="UTF-8"?>
>     <!DOCTYPE application PUBLIC
>           "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
>           "http://java.sun.com/dtd/application_1_3.dtd";>
>     <application>
>       <display-name>ProticPortWeb</display-name>
>     </application>
>
> etc.
>
> I never have used a WAR file in order to deploy an application on a
> web server so I'm not really well-skilled with this technology, but I
> expect it should provoke some problems with the used of Jetty light
> server (actually implemented in a Server.java class like the example
> "restul_http_binding" shows). So I have few questions :
> - If I want to use a HTTP server to easily deploy my app by moving the
> WAR in /webapps's Tomcat like directory, it seems that I have to
> configure the WAR with one ore several XML files (what file,
> MANIFEST.MF ? Application.xml ? web.xml ? Each one ?) instead of using
> Server.java class like example above (class which I would remove I
> think ?), so that the HTTP server knows the services to deploy, am I
> true ?
> - If I'm wrong, does Jetty server can be launched as this by the other
> web server without removing the Server.java class ?
> - A Maven oriented question (I should post it on Maven's user list I
> think) : Maven WAR plugin can generate a WAR file from maven project,
> but deploying files (the ones I have shown above) do not contain
> information about deployment for the server, does Maven can generate
> it from adding information into pom.xml ?
>
> Does one of you knows an easy way to deploy my app without Maven
> commands ? Thanks.

-- 
Daniel Kulp
[email protected]
http://www.dankulp.com/blog

Reply via email to