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,459,312
Community Members
 
Community Events
176
Community Groups

maven cache in pipeline seems not working

Edited

I have added below script in pipeline, but it seems not working , every build take more than 30 min for mvn install , any problem recently for this cache function ?

image: maven:3.6.3

pipelines:

branches:
develop:
- step:
name: Build and Unit Test
artifacts:
- x_api/target/x_api.jar
- checkstyle-result.xml
image: maven:3.6.3
caches:
- maven
script:
#- mvn -B verify --file pom.xml
- cd x_api
- mvn install
- mvn package --batch-mode
- cd ../x_service
- mvn install
- mvn package --batch-mode

 thank you,

Jonas

3 answers

1 accepted

0 votes
Answer accepted

Hi Jonas,

I just wanted to let you know that we have a limit of 1GB for caches, only caches under 1GB once compressed are saved.

Maven cache is saved in the directory ~/.m2/repository, so I would suggest checking the size of this directory during the build and after dependencies are downloaded.

If the repo belongs in a workspace with a paid billing plan (I see you are an admin of such a workspace), you can also create a ticket with the Bitbucket Cloud support team to look into this and confirm if the issue is with the cache size or something different. You can create a support ticket via https://support.atlassian.com/contact/#/, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product.

Kind regards,
Theodora

thank you Theodora for guide , I submitted a ticket to see if any solution.

You are welcome Jonas, please feel free to reach out if you ever need anything else.

Kind regards,
Theodora

I saw below in pipeline log

 

Cache "maven": Not found

 

is there any limit like size of the maven cache , possible exceed the limit cause maven was not cached

@Zhenguo Li  what image do you use? Please provide your full pipeline config and log output

Also take a look at this answer

image: maven:3.6.3

pipelines:

branches:
develop:
- step:
name: Build and Unit Test
artifacts:
- x_api/target/x_api.jar
- checkstyle-result.xml
image: maven:3.6.1
caches:
- maven
script:
#- mvn -B verify --file pom.xml
- cd x_api
- mvn install
- mvn package --batch-mode
- cd ../x_service
- mvn install
- mvn package --batch-mode

 

i can't paste full log here, it just said there is no cache for maven in build setup step.

and there is no any cache shows if I click the Cache button on pipeline's home page.

@Zhenguo Li. To check if maven cache working or not you should try to run pipeline this example repo

If cache is not working its definitely a bug and you may report it.

If cache is working then problem is in your `script section`. I think the reason is that you changing folders and then run `mvn install` when your cache possibly is in upper folder, but i can be wrong.

Look at this answer to understand how to define cache for custom folder

P.S also you do not need

image: maven:3.6.1

in `step` section because you use

image: maven:3.6.3

in the beginning of your pipeline config. I understand that i suggested you to do it but also it explains why i asked you to provide the full pipeline config to provide better help.

Cheers

Hi @Zhenguo Li . At least you should add more details about your pipeline config.

Also take a look at this answer: maven cache not working .
There

image: maven:3.6.1  

was added before caches, maybe this will fix your issue.

Cheers

thank you, @lissyaka ,  but it doesn't work for me .

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events