How to get JIRA installation directory path inside JIRA plugin?

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

2 answers

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.

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

It really depends.

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

(or catalina.base)

0 votes

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);

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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

344 views 0 1
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you