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.
image: maven:3.6.3
pipelines:
default:
- step:
name: Build and Test
caches:
- maven
script:
- mvn -B verify --file pom.xml
artifacts:
- $BITBUCKET_CLONE_DIR/target/helpdesk.war
after-script:
# Collect checkstyle results, if any, and convert to Bitbucket Code Insights.
- pipe: atlassian/checkstyle-report:0.3.0
- step:
name: Security Scan
script:
# 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 File
script:
- pipe: atlassian/bitbucket-upload-file:0.3.3
variables:
BITBUCKET_USERNAME: $BITBUCKET_USERNAME
BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
FILENAME: "$BITBUCKET_CLONE_DIR/target/helpdesk.war"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
and the following for the pipe:
FILENAME: "target/helpdesk.war"
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
when I changed this.
artifacts:
- target/helpdesk.war
then Its worked perfectly.
Now it's available in the download section.
Thanks @Theodora Boudale
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.