Skip to content

Commit

Permalink
SDK-193 - Should not use shared tomcat directory
Browse files Browse the repository at this point in the history
  • Loading branch information
dkayiwa committed Jun 18, 2020
1 parent af711ea commit 1da7f45
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,18 @@ 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;
}
Context root = tomcat.addContext("", tempDirectory.getAbsolutePath());
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);
Expand Down

0 comments on commit 1da7f45

Please sign in to comment.