image: maven:3.6.3
Hi @PATEL PARTHKUMAR and welcome to the community.
The first step of your build defines an artifact in the following location:
build/target/helpdesk.war
This path is relative to the clone directory.
However, in the pipe, you are providing the following path:
"$BITBUCKET_CLONE_DIR/target/helpdesk.war"
The build directory you defined in the first step is missing from this path.
If the file's path (relative to the clone directory) is build/target/helpdesk.war, then you need to use the following in the pipe:
"$BITBUCKET_CLONE_DIR/build/target/helpdesk.war"
Otherwise, if the file is generated in target/helpdesk.war, then you need to change the artifacts definition and omit the build directory.
Kind regards,Theodora
As per your suggestion, I edit my yml file but still getting errors.
pipelines:default:- step:name: Build and Testcaches:- mavenscript:- mvn -B verify --file pom.xmlartifacts:- $BITBUCKET_CLONE_DIR/target/helpdesk.warafter-script:# Collect checkstyle results, if any, and convert to Bitbucket Code Insights.- pipe: atlassian/checkstyle-report:0.3.0- step:name: Security Scanscript:# Run a security scan for sensitive data.# See more security tools at https://bitbucket.org/product/features/pipelines/integrations?&category=security- pipe: atlassian/git-secrets-scan:0.5.1- step:name: Generate War Filescript:- pipe: atlassian/bitbucket-upload-file:0.3.3variables:BITBUCKET_USERNAME: $BITBUCKET_USERNAMEBITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORDFILENAME: "$BITBUCKET_CLONE_DIR/target/helpdesk.war"
Hi @PATEL PARTHKUMAR,
The path in the artifacts definition needs to be a path relative to the clone directory, and additionally, it cannot render variable names. The definition you are using below will not work:
artifacts: - $BITBUCKET_CLONE_DIR/target/helpdesk.war
I see that you have omitted the 'build' directory from the definition. Where is this .war file generated?
The first step is to figure this out.
After you figure out where the file is generated, please use a relative path in both the artifacts section and in the pipe as well, to avoid any confusion.
E.g. if the location of the file relative to the clone directory is build/target/helpdesk.war, then use
artifacts: - build/target/helpdesk.war
and the following for the pipe:
FILENAME: "build/target/helpdesk.war"
If the location of the file relative to the clone directory is target/helpdesk.war, then use
artifacts: - target/helpdesk.war
FILENAME: "target/helpdesk.war"
when I changed this.
then Its worked perfectly.
Now it's available in the download section.
Thanks @Theodora Boudale
It looks like you're new here. Sign in or register to get started.