How to put required jars(not all) in a lib folder inside the final jar with Maven ?

Shanth March 1, 2015
 

4 answers

0 votes
Shanth March 3, 2015

Hi Thank you.Yes any version is fine. Now I get " Failed to execute goal on project : Could not resolve dependencies for project :atlassian-plugin:1.5.3: Could not find artifact org.randombits.math:math-eval:jar:1.0 in atlassian-public (https://maven.atlassian.com/repository/public)" after changing to 6.0.5. How do I search a jar inside the repo page?

Volodymyr Krupach
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.
March 4, 2015

Hi Shanth! You can browse the maven repo in your browser by putting the repo url: https://maven.atlassian.com/repository/public I see that there is no jars for the math-eval: https://maven.atlassian.com/content/groups/public/org/randombits/math/math-eval/ so probably you need to install it to your local maven repo: http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

0 votes
Volodymyr Krupach
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.
March 3, 2015

I see that under atlassian maven repo there is 6.0.5 version: https://maven.atlassian.com/content/groups/public/org/randombits/confluence/confluence-metadata/

Can you use 6.0.5?

If you mus stay with 4.2.2 then you need to install it to your local maven repo and maven will pick it from the local repo. Please see http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

0 votes
Shanth March 3, 2015

Thank you. My situation is I want to add:

<dependency> 
 	<groupId>org.randombits.confluence</groupId> 
	<artifactId>confluence-metadata</artifactId> 
	<version>4.2.2</version> 
</dependency>

But when I build, getting error says: Failed to execute goal on project : Could not resolve dependencies for project :atlassian-plugin:1.5.3: Could not find artifact org.randombits.confluence:confluence-metadata:jar:4.2.2 in atlassian-public (https://maven.atlassian.com/repository/public).

So I manually download the jars and try to add to the final jar.

0 votes
Volodymyr Krupach
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.
March 1, 2015

You do not need to worry about this. Maven does this for you.

One thing worth to remember when developing plugins for atlassian applications is that most libs that you need are already included by your host application and you do not need to declare dependencies with scope provided param:

<scope>provided</scope>

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events