0
$\begingroup$

Rosanswers logo

I read from xml and gram files in my Java node

URL url = MyClass.class.getResource("config.xml");
    configurationManager = new ConfigurationManager(url);

However, this xml file is not included in the jar file created by the gradle. That's why my app will keep returning NullPointerException.

I tried adding files as dependency to build.gradle file, without succes

runtime fileTree(dir: 'src/path/to/my/class', include: ['.gram']) runtime fileTree(dir: 'src/path/to/my/class', include: ['.xml'])

I read at SO , that i should add from "rule" to the jar task, but I can't find it.

So, how can I add files to the jar?


Originally posted by smihael on ROS Answers with karma: 45 on 2015-07-08

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

This answer helped me: http://stackoverflow.com/a/24726945/822644


Originally posted by smihael with karma: 45 on 2015-07-08

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.