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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,466,091
Community Members
 
Community Events
176
Community Groups

War file not getting from download section why?

image: maven:3.6.3

  • pipelines:
    default:
    - step:
    name: Build and Test
    caches:
    - maven
    script:
    - mvn -B verify --file pom.xml
    artifacts:
    - build/target/helpdesk.war
    after-script:
    - pipe: atlassian/checkstyle-report:0.3.0

    - 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"

1 answer

1 accepted

0 votes
Answer accepted

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"

Screenshot from 2022-12-14 23-10-30.png

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?

  • Is it generated in build/target/helpdesk.war inside the clone directory?
  • Or in target/helpdesk.war inside the clone directory? 

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

Like PATEL PARTHKUMAR likes this

 

when I changed this.

artifacts:
- target/helpdesk.war

then Its worked perfectly.

 

Now it's available in the download section.

Screenshot from 2022-12-16 17-42-20.png

 

Thanks @Theodora Boudale 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS

Atlassian Community Events