Ask Your Question
0

Include extra files in jar

asked 2015-07-08 11:02:17 -0600

smihael gravatar image

updated 2015-07-08 11:14:15 -0600

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-07-08 11:29:56 -0600

smihael gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-07-08 11:02:17 -0600

Seen: 837 times

Last updated: Jul 08 '15