Current directory (lodaer.path=.) pathology workaround
It turns out that loader.path=. was pathological and before this change ended up making the classpath empty (loader.path=.,lib/ would have fixed it). With this change the old behaviour is still supported, but if the only user-supplied path entry is "." (or empty) then it is now kept, and translates into the root of the current archive if running as "java -jar ...". Fixes gh-270
This commit is contained in:
@@ -83,7 +83,14 @@ public class PropertiesLauncherTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUserSpecifiedPath() throws Exception {
|
||||
public void testUserSpecifiedDotPath() throws Exception {
|
||||
System.setProperty("loader.path", ".");
|
||||
PropertiesLauncher launcher = new PropertiesLauncher();
|
||||
assertEquals("[.]", ReflectionTestUtils.getField(launcher, "paths").toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUserSpecifiedWildcardPath() throws Exception {
|
||||
System.setProperty("loader.path", "jars/*");
|
||||
System.setProperty("loader.main", "demo.Application");
|
||||
PropertiesLauncher launcher = new PropertiesLauncher();
|
||||
|
||||
Reference in New Issue
Block a user