Which confluence artifact has the LicenseService class

sm shamim September 30, 2012

Hello,

I need to access the Confluence license properties and need to inject LicenseService class. I need to know which maven dependence I need to add?

1 answer

1 vote
Adrien Ragot 2
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.
October 13, 2013

It's in confluence-5.0.3.jar itself ;)

<dependency>
      <groupId>com.atlassian.confluence</groupId>
      <artifactId>confluence</artifactId>
      <version>${confluence.version}</version>
      <scope>provided</scope>
    </dependency>

It should be the same file across all versions, 5.0.3, 4.3, 5.3...

$ unzip -l /.../.m2/repository/com/atlassian/confluence/confluence/5.0.3/confluence-5.0.3.jar  | grep LicenseService
     5022  03-14-13 22:40   com/atlassian/confluence/license/DefaultLicenseService.class
      657  03-14-13 22:40   com/atlassian/confluence/license/LicenseService.class

Gorka Puente _Appfire_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
July 7, 2014

Hi Adrien,

I'm trying to inject the LicenseService in a test class. However, I'm getting this error

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'licenseService': FactoryBean threw exception on object creation; nested exception is java.lang.LinkageError: loader constraint violation: loader (instance of org/springframework/osgi/context/internal/classloader/ChainedClassLoader) previously initiated loading for a different type with name "com/atlassian/extras/api/Product"

I've got in my atlassian-plugin.xml

<component-import key="licenseService" interface="com.atlassian.confluence.license.LicenseService" name="License Service" public="true"/>

And the following in my atlassian-plugin.xml for testing

<component-import key="confluenceLicenseService" interface="com.atlassian.confluence.license.LicenseService" />

Any idea?

Thank you!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events