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

Artifacts immutable?

Hello,

I am using Bitbucket Pipelines and passing a folder between steps works so far, using:

steps:

   - step: &compile
      name: Compile (no tests)
caches:
- maven
artifacts:
- target/**
script:
- mvn --batch-mode compile -DskipTests -DbuildNumber=$BITBUCKET_BUILD_NUMBER

(full version)

However, it seems that once I declared the artifact it is immutable to succeeding steps and they cannot write to it?

I am using Maven with Docker option and it seems that when doing this:

  • Step 1 mvn compile # generates .class file in ./target

  • Steps... with tests etc.
  • Step 4: mvn package # should add .jar file to ./target - not working

That Step 4 cannot add stuff to the {{./target}} folder - files from Step 1 are present (generated .class files).

Here is my pipeline, including directory listings visible in the build logs.

Another user reported a possible similar thingy with Node builds and using the cache. Is this because I am using the Maven cache, that causes my ./target folder to be not writable in following steps? Think that Maven cache only buffers the local Maven Repo.

 

Thanks for any support here,

Timo

1 answer

Turns out I had to add the artifact element in each succeeding step, just like the documentation tells... :(

Suggest an answer

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

Atlassian supported Jenkins integration for Bitbucket Server

We’ve been building a plugin to integrate Bitbucket Server and Jenkins CI, and I’m excited to announce that our alpha is ready to download and install. It lets you seamlessly configure a Jenkins job ...

497 views 0 10
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