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

 

4 answers

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>

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.

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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

606 views 20 11
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