Skip to content

Commit bd3af0c

Browse files
Issue 53209: Allow externalModules folder to be dictated via application.properties file (#1083)
1 parent 6ab0cbd commit bd3af0c

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

server/configs/application.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ context.encryptionKey=@@encryptionKey@@
5858
#context.additionalWebapps.firstContextPath=/my/webapp/path
5959
#context.additionalWebapps.secondContextPath=/my/other/webapp/path
6060

61+
#context.externalModules=/path/to/external/modules/dir
6162
#context.requiredModules=
6263
#context.pipelineConfig=/path/to/pipeline/config/dir
6364
#context.serverGUID=

server/embedded/src/org/labkey/embedded/LabKeyServer.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,8 @@ public static class ContextProperties
431431
private String contextPath = "";
432432
private String pipelineConfig;
433433
private String requiredModules;
434+
/** Path to external modules directory */
435+
private String externalModules;
434436
private boolean bypass2FA = false;
435437
private String serverGUID;
436438
private Integer httpPort;
@@ -576,6 +578,16 @@ public void setRequiredModules(String requiredModules)
576578
this.requiredModules = requiredModules;
577579
}
578580

581+
public String getExternalModules()
582+
{
583+
return externalModules;
584+
}
585+
586+
public void setExternalModules(String externalModules)
587+
{
588+
this.externalModules = externalModules;
589+
}
590+
579591
public boolean isBypass2FA()
580592
{
581593
return bypass2FA;

server/embedded/src/org/labkey/embedded/LabKeyTomcatServletWebServerFactory.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ protected TomcatWebServer getTomcatWebServer(Tomcat tomcat)
175175
{
176176
context.addParameter("requiredModules", contextProperties.getRequiredModules());
177177
}
178+
if (contextProperties.getExternalModules() != null)
179+
{
180+
// We've long supported configuring this via a system property so propagate the value
181+
System.setProperty("labkey.externalModulesDir", contextProperties.getExternalModules());
182+
}
178183
if (contextProperties.getPipelineConfig() != null)
179184
{
180185
context.addParameter("org.labkey.api.pipeline.config", contextProperties.getPipelineConfig());

0 commit comments

Comments
 (0)