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

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


1 badge earned


Participate in fun challenges

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


Gift kudos to your peers

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


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!


Use of a thirdparty jar which used ServiceLoader to load some dependent services not working

I am trying to develop a bamboo task for one of my project. The purpose of this jar is to parse the working directory and create a JSON output. For this purpose, I have also developed a java library which will take the working directory as input and provide a parsed output in JSON. Now, this java library uses java's ServiceLoader to load some dependent service classes. Independently, this library works as expected and loads all the dependencies and does its work. However, on using this library as a third party lib in the plugin, the library is not loading the dependent classes. In some post i saw the loading classes in  atlassian sdk is triky. Please advise what I am doing wrong or missing. 

the pom at the pluging:



The dependencies which would be loaded by serviceLoader at the pom at the buildIspLib: 




The code to load the service implementations. the buildInspLib has the META-INF directory which has the file with the implementing classes in it. Please note, this library works as expected if run outside of the atlassian sdk

//loads all the classes implementing ParserService
ServiceLoader<ParserService> loader = ServiceLoader.load(ParserService.class);

ExecutorService exec = Executors.newCachedThreadPool();

List<Future<ComputedData>> analysersOutput = new ArrayList<>();

System.out.println(" before distribution.."); //THIS LINE GETS PRINTED IN THE PLUGIN

for (ParserService serv : loader) {

try {

System.out.println(" distributing for : "+serv.getAnalyserType()+" );


How am I using this thirdparty lib?

new ParserInspector().inspect(taskContext.getWorkingDirectory().getAbsolutePath())

Please note: the library is being loaded. I can say that because, i could see the logs being printed. However, the service loader is not able to find the implementation classes  


0 answers

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events