From 1da7f45d5b0ba100b4c957187c500d2b0130d55f Mon Sep 17 00:00:00 2001 From: dkayiwa Date: Thu, 18 Jun 2020 19:43:46 +0300 Subject: [PATCH] SDK-193 - Should not use shared tomcat directory --- .../src/main/java/org/openmrs/maven/plugins/RunTomcat.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/maven-plugin/src/main/java/org/openmrs/maven/plugins/RunTomcat.java b/maven-plugin/src/main/java/org/openmrs/maven/plugins/RunTomcat.java index 6baa4d12..aa6904cb 100644 --- a/maven-plugin/src/main/java/org/openmrs/maven/plugins/RunTomcat.java +++ b/maven-plugin/src/main/java/org/openmrs/maven/plugins/RunTomcat.java @@ -151,6 +151,11 @@ public void execute() throws MojoExecutionException, MojoFailureException { wizard.showMessage("Starting Tomcat...\n"); Tomcat tomcat = new Tomcat(); + + //Tomcat needs a directory for temp files. This should be the first + //method called, else it will default to $PWD/tomcat.$PORT + tomcat.setBaseDir(tempDirectory.getAbsolutePath()); + if (port == null) { port = 8080; } @@ -158,7 +163,6 @@ public void execute() throws MojoExecutionException, MojoFailureException { tomcat.addServlet("", "openmrsRedirectServlet", new OpenMRSSDKRedirectServlet()); root.addServletMapping("/*", "openmrsRedirectServlet"); tomcat.setPort(port); - tomcat.setBaseDir(tempDirectory.getAbsolutePath()); tomcat.getHost().setAppBase(tempDirectory.getAbsolutePath()); tomcat.getHost().setAutoDeploy(true); tomcat.getHost().setDeployOnStartup(true);