How to say jetty-runner to not use random dir

413 views Asked by At

I´m using jetty-runner to start my application. On every start it creates an new temp folder. I would like to avoid it. Here is my example:

java -Djava.io.tempdir=webapp -jar jetty-runner-9.3.0.M2.jar wars\*.war context.xml

When I start it, it creates a folder in webapp jetty-0.0.0.0-8080-mywar.war-_-any-2227787194488516977.dir. So it uses the right syntax "jetty-"+host+"-"+port+"-"+resourceBase+"-_"+context+"-"+virtualhost+"-"+randomdigits+".dir".

My question ist how to avoid it, to generate random digits. I would like to reuse webapps and only genreate new one, if my wars changes.

2

There are 2 answers

0
Vitali Heinrich On BEST ANSWER

So how I see, there is no chance to avoid generation of randomdigits :-( See source code: org.eclipse.jetty.webapp.WebInfConfiguration

3
vels4j On

By default, Jetty will create a temporary directory for each web application. The name of the directory will be of the form:

"jetty-"+host+"-"+port+"-"+resourceBase+"-_"+context+"-"+virtualhost+"-"+randomdigits+".dir"

Each time when you start jetty, it use to check the war file with existing deployment folder and If it identifiyes war file is changed, jetty deletes old depolyment folder and deploy the changed war as fresh. You need not worry about the deployment.