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

 

4 answers

This widget could not be displayed.

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>
This widget could not be displayed.

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.

This widget could not be displayed.

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

This widget could not be displayed.

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?

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

509 views 7 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you