Is there a way to tell that JIRA runs on an academic license?

Igor Sereda [ALM Works]
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.
September 25, 2011

We'd like to match Atlassian academic discount with the same discount for our plugin, but we'll need to check whether JIRA runs on an academic license from Atlassian. Looking at com.atlassian.jira.license.LicenseDetails class, I don't see any method like isAcademic().

Is it possible to tell whether JIRA runs on an academic license?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Andy Brook [Plugin People]
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.
April 26, 2012

Just looking at this now, from what I can see, the LicenseDetails class does implement isAcademicLicense() however, its private for some reason unlike all the others. Given the LicenseDetails class also doesn't expose the underlying JiraLicense object it's not possible to directly re-implement the method which would be 'easy'.

What I think may work, is testing for isUnlimitedNumberOfUsers() and verifying that all other known license types are not matches (ie not Commercial, not Open Source (sigh)), going to give that a spin myself. Anyone have a better idea?

Igor Sereda [ALM Works]
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.
April 27, 2012

Yeah, thanks - I think going through reflection for isAcademicLicense is the best way, but IF it would really return true in the case of an academic license. This needs to be verified - since it is not part of the public API, our assumption based on the sources may be wrong. For example if academic license is actually a 50% discount for a normal commercial license.

(Checking for isUnlimitedNumberOfUsers, as you suggest, does not make sense to me - can't academic license be less than unlimited?)

Andy Brook [Plugin People]
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.
April 27, 2012

Yea quite right, best way is reflection, for anyone passing:

boolean isAcademic=false;
try
{
  Method method = jiraLicense.getClass().getDeclaredMethod("isAcademicLicense");
  method.setAccessible(true);
  Object result = method.invoke(jiraLicense);
  isAcademic=((Boolean)result).booleanValue();
}
catch (Exception e)
{
  //do something
  e.printStackTrace();
}

TAGS
AUG Leaders

Atlassian Community Events