Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 972a7f9

Browse files
committed
#103 Added support for mlModulePaths
1 parent f3296c6 commit 972a7f9

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/main/java/com/marklogic/appdeployer/DefaultAppConfigFactory.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package com.marklogic.appdeployer;
22

33
import java.io.File;
4+
import java.util.ArrayList;
45
import java.util.Arrays;
6+
import java.util.List;
57

68
import com.marklogic.mgmt.util.PropertySource;
79
import com.marklogic.mgmt.util.PropertySourceFactory;
@@ -143,6 +145,18 @@ public AppConfig newAppConfig() {
143145
c.setUseRoxyTokenPrefix(Boolean.parseBoolean(prop));
144146
}
145147

148+
prop = getProperty("mlModulePaths");
149+
if (prop != null) {
150+
logger.info("Module paths: " + prop);
151+
String[] paths = prop.split(",");
152+
// Ensure we have a modifiable list
153+
List<String> list = new ArrayList<>();
154+
for (String s : paths) {
155+
list.add(s);
156+
}
157+
c.setModulePaths(list);
158+
}
159+
146160
return c;
147161
}
148162

src/test/java/com/marklogic/appdeployer/DefaultAppConfigFactoryTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.marklogic.appdeployer;
22

3+
import java.util.List;
34
import java.util.Properties;
45

56
import org.junit.Assert;
@@ -60,6 +61,7 @@ public void allProperties() {
6061
p.setProperty("mlAppServicesPort", "8123");
6162
p.setProperty("mlReplaceTokensInModules", "false");
6263
p.setProperty("mlUseRoxyTokenPrefix", "false");
64+
p.setProperty("mlModulePaths", "path1,path2,path3");
6365

6466
sut = new DefaultAppConfigFactory(new SimplePropertySource(p));
6567
AppConfig config = sut.newAppConfig();
@@ -83,6 +85,11 @@ public void allProperties() {
8385
assertEquals((Integer) 8123, config.getAppServicesPort());
8486
assertFalse(config.isReplaceTokensInModules());
8587
assertFalse(config.isUseRoxyTokenPrefix());
88+
89+
List<String> paths = config.getModulePaths();
90+
assertEquals("path1", paths.get(0));
91+
assertEquals("path2", paths.get(1));
92+
assertEquals("path3", paths.get(2));
8693
}
8794

8895
@Test

0 commit comments

Comments
 (0)