How to add third pary jar files in your custom macro?

UdayK
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.
February 5, 2013

Hi

I'm developing a macro which requires to use the third party jar file. I configured the jar file in the build path to compile.

I 'm able to compile(atlas-compile) and package(atlas-package) and deploy through the admin console, But unable to execute the macro.

Problem is the third party jar file is not avaliable to the confluence instance. How to make the third party jar files available to confluence instance.

How to add the third party jar files to our custom plug-in?

Please help me in this.

2 answers

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
Mizan
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.
February 5, 2013

You will need to add these jars as a dependency in the pom.xml ... In some cases you will first need to install it in your local repository .

Refer this docs

UdayK
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.
February 6, 2013

I added the maven dependency in my pom.xml and the jar file has been placed in the local repository. But after deploying the plugin in the confluence instance, It is throwing error related to class not found as i'm referring the class which is there in jar file. Compiling and packaging has been OK. Only the problem of running the macro which has third party jar file code.

Note: If i add the jar file in the 'META-INF/lib' and deploy it, macro is working fine. But the thing is , Adding the jar in META-INF/lib is manual process, which is not suggestable.

If there is a way to handle the third party jar files in a custom macro, Please let us know.

Thanks in advance.

Mizan
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.
February 6, 2013

Add the dependcy in the following format if the jar is installed in your repository

<dependency>
<groupId>com.oracle</groupId>
<artifactId>oracle</artifactId>
<version>11.2.0.1.0</version>
</dependency>

This worked for me when I wanted to add oracle drivers in one plugin

0 votes
UdayK
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.
February 11, 2013

Adding the jar in your local repository and adding the dependency in your pom.xml is the solution. Flip side of this is the jar's class files will be stored in your(Macro) classes folder.

TAGS
AUG Leaders

Atlassian Community Events