The downside of using com.atlassian.jira.jira-core dependency? Edited

When the SDK creates a plugin, it comment the com.atlassian.jira.jira-core dependency:

<!-- Add dependency on jira-core if you want access to JIRA implementation classes as well as the sanctioned API. -->
<!-- This is not normally recommended, but may be required eg when migrating a plugin originally developed against JIRA 4.x -->
<!--
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-core</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
</dependency>
-->

Why is this normally not recommended and what are the downsides?

I want to use SelectCFType from it.

Thx

 

1 answer

1 accepted

2 votes
Gaston Valente Community Champion Jul 23, 2017

Harald,

Getting that dependency allows your code to reference direct classes at a lower level that the recommended by using services and manager interfaces.

I think that the downside is related to the grade of coupling your code will had with atlassian's api.

Sometimes, if you need to reference concrete classes, for example to inherit from them, this is required.

Just for you to know, i just try to remove this dependency in a custom mail handler i have that uses SelectCFType:

<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-core</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
</dependency>

Then i cannot use concrete classes:

Screen Shot 2017-07-23 at 22.29.33.png 

 

Good answer. Loose coupling always makes sense. Even if the Jira Core classes will not change very frequently. Thx

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,129 views 13 19
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot