Skip to content

Commit 0b07bca

Browse files
committed
search play.plugins descriptor in application path
* it's important when <application dir> is not the same as <working dir> * in other words, when admin starts the application with a command like `cd /tmp && play start ~/hello`
1 parent 1094543 commit 0b07bca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

framework/src/play/plugins/PluginCollection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ List<URL> loadPlayPluginDescriptors() {
196196
try {
197197
String playPluginsDescriptor = Play.configuration.getProperty("play.plugins.descriptor");
198198
if (playPluginsDescriptor != null) {
199-
return Collections.singletonList(new File(playPluginsDescriptor).toURI().toURL());
199+
return Collections.singletonList(new File(Play.applicationPath, playPluginsDescriptor).toURI().toURL());
200200
}
201201
return Collections.list(Play.classloader.getResources(play_plugins_resourceName));
202202
}

framework/test-src/play/plugins/PluginCollectionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public void canLoadPlayPluginsFromASingleDescriptor() throws Exception {
9898
Play.configuration.setProperty("play.plugins.descriptor", "test-src/play/plugins/custom-play.plugins");
9999
PluginCollection pc = new PluginCollection();
100100
assertThat(pc.loadPlayPluginDescriptors()).containsExactly(
101-
new File("test-src/play/plugins/custom-play.plugins").toURI().toURL()
101+
new File(Play.applicationPath, "test-src/play/plugins/custom-play.plugins").toURI().toURL()
102102
);
103103
}
104104

0 commit comments

Comments
 (0)