How to get JIRA installation directory path inside JIRA plugin?

Sushant June 16, 2013

I want to display JIRA installation directory path to JIRA admin user. How can I get installation directory path usng api?

2 answers

0 votes
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 16, 2013

You can use JIRAHome as well, if you must need the plugins directory.

https://docs.atlassian.com/jira/latest/com/atlassian/jira/config/util/JiraHome.html#getPluginsDirectory%28%29

You can inject JiraHome in the constructor or get it using ComponentAccessor.

JiraHome jiraHome = ComponentAccessor.getComponent(JiraHome.class);

Sushant June 16, 2013

Hi Jobin,

I need path of JIRA installation directory, as I want to display location of startup.sh and shutdown.sh file on my plugin screen. Can I do that by using ComponentAccessor? Because I have checked api of ComponentAccessor and didnt find anything for JIRA installation directory. I know hoe to get JIRA home directory, but its of no use to me.

0 votes
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 16, 2013

If you can indicate what the final aim, it may help.

ClassLoaderUtils.getResource usually helps to read directories and files provided, they are with the webapp directory.

Sushant June 16, 2013

hey Renjith,

On my plugin screen i want to display location of startup.sh and shutdown.sh.
For that I need to get JIRA installation directory path

Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 16, 2013

It really depends.

System.getProperty("user.dir") might help, but I am not sure if it is portable (WAR deployments).

(or catalina.base)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events