changed
resouceloader - > classloader for maven package error
This commit is contained in:
parent
d3da1158ea
commit
c3f8889bdd
|
@ -106,7 +106,8 @@ public class WMICrawlerTest {
|
||||||
|
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
|
||||||
String p = ResourceLoader.class.getClass().getResource("/config/example.json").getPath();
|
ClassLoader classLoader = getClass().getClassLoader();
|
||||||
|
String p = classLoader.getResource("config/example.json").getFile();
|
||||||
|
|
||||||
System.out.println(p);
|
System.out.println(p);
|
||||||
|
|
||||||
|
@ -121,7 +122,8 @@ public class WMICrawlerTest {
|
||||||
public void testWMIJson() throws Exception {
|
public void testWMIJson() throws Exception {
|
||||||
|
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
String p = ResourceLoader.class.getClass().getResource("/config/example.json").getPath();
|
ClassLoader classLoader = getClass().getClassLoader();
|
||||||
|
String p = classLoader.getResource("config/example.json").getFile();
|
||||||
Config c = mapper.readValue(new File(p),Config.class);
|
Config c = mapper.readValue(new File(p),Config.class);
|
||||||
|
|
||||||
// Map<String, Object> map = new HashMap<>();
|
// Map<String, Object> map = new HashMap<>();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user