In this section, we will look at how to use Cargo's Maven plugin to deploy a WAR to Jetty, in this case we will deploy a WAR to a Jetty 9.x instance. This means that we will access our web app from the URL This ability to customize the context path is one of the great advantages of the context file approach of deploying WARs in Jetty as some app names may not be convenient for this purpose. Notice that we have set the contextPath attribute to /jetty. This context file must have the same name as our WAR, with XML file extension. We will then create jetty-app.xml with the following code and place it inside webapps: Let's undeploy the jetty-app.war we just deployed by deleting it from webapps. This way, even if our WAR file is located on a desktop or we have chosen to keep it in jetty-app/target where Maven places the package, we can just create its context file inside $JETTY_HOME/webapps. Jetty web server offers us a way to deploy a web archive located anywhere in the file system by us creating a context file for it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |