Bitbucket管道Maven缓存未缓存所有工件

时间:2020-08-26 13:17:49

标签: bitbucket-pipelines

我在管道中使用了Maven缓存,我有一个问题。在我的settings.xml中,我为lib_release和lib_snapshot定义了privet Jfrog存储库。

definitions:
  steps:
    - step: &compile
        name: compile
        caches:
          - maven
        script:
          - mvn -s settings.xml clean compile package
        artifacts:
          - target/**

I see that in Build stage artifacts are Downloaded from the maven cache:

>Cache "maven": Downloading.  
>Cache "maven": Downloaded 103.5 MiB in 4 seconds.  
>Cache "maven": Extracting.  
>Cache "maven": Extracted in 1 seconds

But during the build I see that some .pom, maven-metadata.xml, and some .jar files still downloading from my privet Jfrog artifactory.

For example:
>Downloaded from snapshots: https://jfrog.com/libs-snapshot/my-data/1.5.1-SNAPSHOT/my-data--1.pom (6.3 kB at 8.7 kB/s) 


*So the question is why this data is not cashed?*

1 个答案:

答案 0 :(得分:0)

这是一个快照。始终检索快照以确保构建具有最新版本。只有服务器知道快照的最新版本(您可以执行 mvn clean install 并查看本地存储库以查看生成的 pom 是如何工作的)。

https://maven.apache.org/guides/getting-started/index.html#What_is_a_SNAPSHOT_version