Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,464,266
Community Members
 
Community Events
176
Community Groups

How to include org.eclipse.jgit packages in my plugin?

Edited

For a plugin I'm developing, I need to use classes from package org.eclipse.jgit (e.g. RevWalk).

Few findings: 

  • There is no OSGi bundle that exports this package.
  • The OSGi bundle atlassian-bamboo-plugin-git uses this org.eclipse.jgit package, but doesn't export it.
  • The OSGi bundle atlassian-bamboo-plugin-git has the the  META-INF/lib/org.eclipse.jgit-3.5.3-atlassian-13.jar in the 'Bundle Classpath'. This jar contains the classes I need, but I'm not sure how useful this is for my plugin.
     

When I include this bamboo git bundle/package to my pom.xml file,

<dependency>
<groupId>com.atlassian.bamboo.plugins</groupId>
<artifactId>atlassian-bamboo-plugin-git</artifactId>
<version>6.2.2</version>
<scope>provided</scope>
</dependency>

my code compiles just fine; it can find all the org.eclipse.jgit classes, (presumably because these are part of the git plugin?)

But then the problems start for me. I tried many different combinations of 'import-packages'. But it either errors during install that it can't find a bundle, or I'm getting a noClassDefFoundError.

Also added the org.eclipse.jgit as a separate dependency and compiled it with my plugin. Still errors during my install.

If anybody has successfully imported org.eclipse.jgit classes in their plugin (in combination with using the bamboo git plugin), I am very curious what the pom.xml settings are.

1 answer

Hi Wouter

Can remove from your pom entry

<scope>provided</scope>

 If scope is provided then it does not include that library in package.

Please try it.

Thanks

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events