Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

bitbucket pipeline external jar issue to create build

i am trying to create a build using bitbucket pipeline and my project is using an external jar file for which i am getting the error, the issue was there on laptop too. but when i place the dependency on ./m2 direcotry it got resolved but i am not aware where to place it in bitbucketcloud my error that i am facing[ERROR] Failed to execute goal on project Demo: Could not resolve dependencies for project com.example:Demo:jar:0.0.1-SNAPSHOT: Could not find artifact com.comviva.cms:KpiCommonLib:jar:1.0 at specified path /opt/atlassian/pipelines/agent/build\src\lib\KpiCommonLib-1.0.jar -> [Help 1]
10:38 am

error logs last few lines.
Skipping Demo
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.858 s
[INFO] Finished at: 2021-10-01T09:11:55Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Demo: Could not resolve dependencies for project com.example:Demo:jar:0.0.1-SNAPSHOT: Could not find artifact com.comviva.cms:KpiCommonLib:jar:1.0 at specified path /opt/atlassian/pipelines/agent/build\src\lib\KpiCommonLib-1.0.jar -> [Help 1]
[ERROR]

1 answer

0 votes

Hi Vishal,

Based on the output, it looks that the build is trying to find the file at this path:

/opt/atlassian/pipelines/agent/build\src\lib\KpiCommonLib-1.0.jar

Just to give you some context first:
- when a Pipelines build runs, a Docker container starts for each step
- then, the repo is cloned in the directory /opt/atlassian/pipelines/agent/build in that Docker container (this is the clone directory)
- then, the commands of the script for that step from your yml file are executed in the above directory

Does the directory src\lib exist in your repo? Or is it a directory that is generated during the build?

Also, is this jar file (KpiCommonLib-1.0.jar) uploaded on some server you can download it from during the build?

If so, you could try downloading the jar file in that location (src\lib) using e.g. a wget or curl command in your yml file, before the command that gives you this error.

Kind regards,
Theodora

Dear Theodora,

Does the directory src\lib exist in your repo?-- Yes, i tried this attempt to place my jars under src/lib directory manually created before execution of pipeline but with or without placing jars same response were coming.

Also, is this jar file (KpiCommonLib-1.0.jar) uploaded on some server you can download it from during the build?--- Yes i have already tried it picking from another repository like in step 3 mentioned below.

apart i have tried below ways, i will try to do this using wget as per your suggestion and will post my response.

i have tried following approach.

1. in my build 28 

https://bitbucket.org/comvivacms/tukcode/commits/4cc34ccbf8607acc3eda2f04dcabbcf4bb800647

in this i tried to pick the dependencies from another repository.

2. build 33 tried using basedir to pick external jars

https://bitbucket.org/comvivacms/tukcode/commits/be32c45ae7332c17490461a6f918290b68c88afc

3. tried repositories tag in pom file and pick external jars like

+<repository>
+    <id>dropwizard-core-1.3.5.jar</id>
+    <url>https://bitbucket.org/comvivacms/tukcode/src/master/GSBL/tuk-api/lib/</url>
+</repository>

4. using system path in pom.xml

+    <systemPath>{project.basedir}/src/main/resources/lib/trace-manager-lib-1.0.0.4.jar</systemPath>

Regards,

Vishal Jain

Dear Mr.Theodora,

i tried to implement your suggested solution but unfortunately there is no result.

here are logs of my pipeline now after picking it using wget.

Build setup13s
cd GSBL/tuk-api/lib<1s
wget "http://18.216.70.25/KpiCommonLib-1.0.jar"<1s
wget "http://18.216.70.25/bcfgconnector-1.1-SNAPSHOT.jar"<1s
wget "http://18.216.70.25/bcfg-online.jar"<1s
wget "http://18.216.70.25/trace-manager-filter-1.0.jar"<1s
wget "http://18.216.70.25/trace-manager-lib-1.0.0.4.jar"<1s
wget "http://18.216.70.25/trace-manager-lib-1.0.jar"<1s
wget "http://18.216.70.25/trace-manager-lib.jar"<1s
wget "http://18.216.70.25/bcfg-connector.jar"
at the end of pipeline execution same error message is coming while system picked all jars.
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact com.comviva:bcfg-online:jar:3.0 in bcfgconnector-1.1-SNAPSHOT.jar (file://opt/atlassian/pipelines/agent/build/GSBL/tuk-api/lib)
You may check the logs of my pipeline:
https://bitbucket.org/comvivacms/tukcode/addon/pipelines/home#!/results/42

Regards,
vishal jain

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

229 views 2 5
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you