It's all about the answers!

Ask a question

How to link property file in follow up plugin?


Avinash Bamane (20215) | asked Nov 19 '15, 3:52 a.m.
edited Nov 19 '15, 3:53 a.m.
Hello,
I am having follow up plugin. I want to use property file to have some values. I created property file under resource folder which at the same level of 'src' folder. I used below code to fetch property file details,

String propFileName = "severity.properties";
                    InputStream inputStream = getClass().getClassLoader().getResourceAsStream(propFileName);        
                    if (inputStream != null) {
                        prop.load(inputStream);
                        System.out.println(prop.getProperty("avinash"));
                        System.out.println(prop.getProperty("company"));
                    } else {
                        System.out.println("null");
                    }

Here is the content of my build.properties,
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
               .,\
               plugin.xml
src.includes = resources/

But, each and every time I am getting inputstream as a null. Please suggest.
Thanks.

One answer



permanent link
Michele Pegoraro (1.8k14119103) | answered Nov 19 '15, 8:06 a.m.
edited Nov 19 '15, 8:06 a.m.
I'm not sure it is possible. I've tried in the past without success. But generally I think it would be better to put the configurations on the process schema so they can be modified without repackage and redeploy. Why do you want to have these properties fixed inside the plugin?

Comments
Ralph Schoon commented Nov 19 '15, 8:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Agreed. See https://jazz.net/library/article/1000 for how to do this.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.