Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get artifact after build (using gradle)

Nicolas Trzcionka
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 27, 2018

Hello,

I use BitBucket pipeline for ci/cd

I'm confuse because I can't retrieve my artifact after build my project with gradle

In local machine, my artifact is generated on \build\libs (defaut gradle path)

But using pipelines, I can't get it after build, I can see artifact tab using the UI but it's empty

this is my yml configuration : 

image: openjdk:8

pipelines:

      default:

            - step:

                   caches: - gradle

                    name: Build sephogate approbation project script

                     - bash ./sephogate-workflow-approbation-master/gradlew build

                   artifacts:

                     - sephogate-workflow-approbation-master/build/libs/*.jar

Build is OK, no error (even in the logs)

 

Regards,

2 answers

1 vote
Nicolas Trzcionka
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 4, 2018

Hello Philip,

Thanks for your answer,

In local machine the generated files are in /build/libs directory/

 

And pipeline log (Build teardown) give :

Searching for test report files in directories named [test-results, failsafe-reports, test-reports, surefire-reports] down to a depth of 4Finished scanning for test reports. Found 0 test report files.Merged test suites, total number tests is 0, with 0 failures and 0 errors.

Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 4, 2018

Looks like it didn't find the artifact.

Can you run these commands at the end of your build step?

cd ~
ls -Rla
ls -Rla | grep jar

That will list every file in your step. It will also show all files names containing the string "jar". Hopefully that helps.

0 votes
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 1, 2018

Hi Nicolas,

Can you confirm that the files you need exist in the `sephogate-workflow-approbation-master/build/libs/` directory? Your configuration looks correct, to me.

Are there errors in the 'Build teardown' section of your pipeline logs? We have artifact upload information there.

Thanks,

Phil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events