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

Artifacts immutable?

Timo Böwing March 22, 2019

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

0 votes
Timo Böwing April 7, 2019

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
TAGS
AUG Leaders

Atlassian Community Events