Berth: way of the recovered war

I deployed the .war file inside Jetty Server.

The server was started, but please tell me where can I see the contents of this war file?

I read that:

If the extract parameter is true, any packed war or zip files will first need to be extracted to a temporary directory before deployment.

Please tell me where can I set the extract true parameter and what will be the temporary path to the folder?

This is my jetty-webapps.xml file

 <Configure id="Server" class="org.eclipse.jetty.server.Server"> <Ref id="DeploymentManager"> <Call id="webappprovider" name="addAppProvider"> <Arg> <New class="org.eclipse.jetty.deploy.providers.WebAppProvider"> <Set name="monitoredDirName"><Property name="jetty.home" default="." />/webapps</Set> <Set name="defaultsDescriptor"><Property name="jetty.home" default="."/>/etc/webdefault.xml</Set> <Set name="scanInterval">1</Set> <Set name="contextXmlDir"><Property name="jetty.home" default="." />/contexts</Set> <Set name="extractWars">true</Set> </New> </Arg> </Call> </Ref> </Configure> 
+6
source share
3 answers

All war files that you deploy are extracted to Jetty_Home/work for deployment. But if you want the military files to be extracted to the temp folder before being deployed to the working folder, you can set the extractWars parameter to true in the jetty-webapps.xml . The jetty-webapps.xml is located in the Jetty_HOME/etc/ folder.

 <Configure id="Server" class="org.eclipse.jetty.server.Server"> <Ref id="DeploymentManager"> <Call id="webappprovider" name="addAppProvider"> <Arg> <New class="org.eclipse.jetty.deploy.providers.WebAppProvider"> <Set name="monitoredDirName"><Property name="jetty.home" default="." />/webapps</Set> <Set name="defaultsDescriptor"><Property name="jetty.home" default="."/>/etc/webdefault.xml</Set> <Set name="scanInterval">1</Set> <Set name="contextXmlDir"><Property name="jetty.home" default="." />/contexts</Set> <Set name="extractWars">true</Set> </New> </Arg> </Call> </Ref> </Configure> 
+4
source

Check the log file. It should be like this

2012-11-06 17: 41: 54.334: INFO: oejw.WebInfConfiguration: Extract jar: file: /usr/oc/jcast8083/webapps/spdy.war! /To/tmp/jetty-0.0.0.0-8083 -spdy. war-_spdy-any- / WebApp

In this case, the contents of the war file are in

/tmp/jetty-0.0.0.0-8083-spdy.war-_spdy-any-/webapp

+7
source

In accordance with this Link :

You have few options.

1) Specify your own java.io.tmpdir java system property to use the pier.

 $ java -Djava.io.tmpdir=/path/to/my/new/temp/ -jar start.jar 

2) Create the "work" directory on the path ${jetty.home} (if so). This will force Jetty to use this working directory instead of what is set for the java.io.tmpdir property.

3) Specify the tempDir attribute in WebAppProvider deployments.

Valid for military file deployment scenarios only, NOT applicable for context-based deployment.

If you have etc/jetty-webapps.xml in start.ini , you have options for deploying military files.

Edit the file ${jetty.home}/etc/jetty-webapps.xml and add 1 more attribute to WebAppProvider. <Set name="tempDir">/path/to/my/preferred/temp/dir/for/all/webapps</Set>

4) Set the tempDirectory attribute to WebAppContext using context-based deployments. Not valid for deployment scenarios for military files.

If you have etc/jetty-context.xml in your start.ini , you have enabled context-based deployments.

Edit ${jetty.home}/contexts/myapp.xml and add the tempDirectory attribute to WebAppContext. <Set name="tempDirectory">/path/to/my/preferred/temp/dir/for/this/context</Set>

0
source

Source: https://habr.com/ru/post/905516/


All Articles