title: How to use bitbucket pipeline to generate war file and copy it to downloads?
body: <p>I want to use bitbucket as a maven repository for a personal project. My plan is to use bitbucket pipelines to build the project and copy the war file to the downloads page. After the build finishes successfully, I get the following message:</p>
  <p><code>Building war: /opt/atlassian/pipelines/agent/build/todoey-be/target/todoey.war</code></p>
  <p>but when the second pipeline is run to copy the war, I get the following:</p>
  <p><code>File opt/atlassian/pipelines/agent/build/todoey-be/target/todoey.war doesn't exist.</code></p>
  <p>Also the artifacts tab is empty.</p>
  <p><a href="https://i.stack.imgur.com/8dFmO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8dFmO.jpg" alt="enter image description here" /></a></p>
  <p>bitbucket_pipelines.yaml:</p>
  <pre class="lang-yaml prettyprint-override"><code>image: maven:3.6.3
  
  pipelines:
    default:
      - step:
              name: Build and Test
              caches:
                - maven
              script:
                - mvn clean compile package
              artifacts:
                - opt/atlassian/pipelines/agent/build/todoey-be/target/todoey.war
      - step:
          name: Generate and deploy war
          script:
            - pipe: atlassian/bitbucket-upload-file:0.3.2
              variables:
                BITBUCKET_USERNAME: $BITBUCKET_USERNAME
                BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
                FILENAME: &quot;opt/atlassian/pipelines/agent/build/todoey-be/target/todoey.war&quot;
  </code></pre>