3d party JAR dependency

Andrey Molchanov November 25, 2013

I need to use a third-party jar in my plugin (Aspose.Words to be specific).

I know about using Maven local repository dependency with compile scope. Unfortunately, we need another method as long as this one doesn't work for our plugin - it is not Maven compatible maybe.

Maybe, some kind of placing words.jar to JIRA class path or something else?
Please, help.

6 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Issa November 25, 2013

Hi,

You should 'import' this jar into your maven repository (or your company Nexus) https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

Then update your pom.xml and keep compile scope.

It should work (hopefully ;-) - good luck

Andrey Molchanov November 25, 2013

As I mentioned,

I know about using Maven local repository dependency with compile scope. Unfortunately, we need another method as long as this one doesn't work for our plugin - it is not Maven compatible maybe.

Issa November 25, 2013

There is no such thing as a jar not compatible with maven. And as Atlassian relies heavily on maven to build plugins - you better 'import' this jar into your maven repos...

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.
November 25, 2013

Issa is right on this, please read the documentation on how to install jars into a maven repo.

Andrey Molchanov December 1, 2013

Issa, there is a signed library (Aspose.Words) to be specific that works wrong when extracted to another JAR root.

So I need a way to use it without extracting JAR content to the plugin.

Issa December 1, 2013

Please look at this page - you need to build an OBR

0 votes
Tayyab Bashir
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.
June 23, 2016

Where should I run this command? 

0 votes
Andrey Molchanov June 23, 2016

@Muhammad Tayyab Bashir, for my specific case it was a problem with my environment (I am sure, it isn't your case). Just google how to use compile dependencies.

 

<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words-jdk16</artifactId>
<version>13.10.0</version>
<scope>compile</scope>
</dependency>

 

In order to package the plugin you need to add Aspose.Words library to the local Maven repository.

Use the following command:
mvn install:install-file -Dfile=Aspose.Words.jdk16.jar -DgroupId=com.aspose -DartifactId=aspose-words-jdk16 -Dversion=13.10.0 -Dpackaging=jar
0 votes
Tayyab Bashir
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.
June 22, 2016

Hi @Andrey Molchanov, I'm also making use of 3rd party dependency in my plugin (Suite utilities for Jira).

Whenever I try to compile it gives error that it couldnt resolve the dependency because it couldn't find it maven public repo. 

Can you please help me out with this?

Take a look at the following questions posted by me for more details if you need it.
https://answers.atlassian.com/questions/39154669And How to resolve third party dependencies in plugin?


I would appreciate it greatly. 
Many thanks in advance 

0 votes
Andrey Molchanov December 9, 2013

OK, it was a simple encoding mistake that has been solved using I18N. Thank you, guys!

0 votes
Nick December 1, 2013

Issa, building an OBR is not an option as long as the library in not an OSGi bundle in its own right. So it has its own manifest file. I attached the library JAR. Any ideas? ()

Issa December 1, 2013

Yes indeed for the OSGI requirements.

I'm clueless on what to do next. Either fix the problem with the JAR authors or fix it yourself (make it a OSGI bundle).

Maybe someone more knowledgeable than me might help.

Good luck.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events