Home > Blockchain >  Bitbucket maven cache and the clean phase
Bitbucket maven cache and the clean phase

Time:06-22

I'm newish to DevOps and new to Maven and I have a question regarding the Bitbucket maven cache.

Our current build pipeline is set to use a maven cache, and the actual build command is ./mvnw clean install. In my head this doesn't make any sense to me because anything that was cached by the pipeline in the last build, will be 'cleaned' in the next build by the clean phase. Does that sound right, or am I missing something?

Thank you for the help.

Scott

CodePudding user response:

mvn clean will only remove build artifacts from your project's folders.

BitBucket by default caches Maven's ~/.m2 folder where it downloads all the dependencies used in your build. Nothing in there is getting wiped with clean.

https://www.marcobehler.com/guides/mvn-clean-install-a-short-guide-to-maven

https://support.atlassian.com/bitbucket-cloud/docs/cache-dependencies/#Pre-defined-caches

  • Related