【问题标题】:How to configure Maven or Apache Archiva that it keeps only N builds of an snapshot如何配置 Maven 或 Apache Archiva,使其仅保留 N 个快照的构建
【发布时间】:2017-11-02 22:42:18
【问题描述】:

我们的 Archiva 存储库从不删除旧快照。 这会产生很多垃圾。

是否可以告诉 Archiva 只保留 N 个版本的快照?

最好的问候, 克里斯蒂安。

【问题讨论】:

    标签: maven archiva


    【解决方案1】:

    请转至http://archiva.apache.org/docs/2.2.0/adminguide/repositories.html

    你会发现以下

    repository purge by days older - the first option for repository purge. Archiva will  check how old the artifact is and if it is older than the set number of days in this field,  then the artifact will be deleted respecting the retention count (see #7) of course. In order to disable the purge by number of days old and set Archiva to purge by retention count, just set the repository purge field to 0. The maximum number of days which can be set here is 1000. See the Repository Purge section below for more details.
    repository purge by retention count - the second option for repository purge. When running the repository purge, Archiva will retain only the number of artifacts set for this field for a specific snapshot version. See the Repository Purge section below for more details. 
    delete released snapshots - specifies whether to remove those snapshot artifacts which already has release versions of it in the repository during repository purge. 
    

    【讨论】:

    • 并且配置完以上参数后,别忘了去“Repository Scanning -> Consumers”,确保“repository-purge”已启用(点击图标启用/禁用)。
    • 我们使用的是archiva 2.2.1,即使在消费者中使用“存储库”扫描,“按日期”似乎也不起作用。执行“存储库清除”任务,输出总/平均时间和计数,但是......似乎没有任何内容被删除。我试图提高日志级别,但是...似乎没有选项,也没有 log4j.xml 配置文件
    【解决方案2】:

    别忘了去:

    Repository Scanning -> Consumers
    

    并确保repository-purge 已启用

    【讨论】:

      【解决方案3】:

      我知道它已经得到解答,但我最近遇到了同样的问题,不得不再做一步:repo 的路径指向错误的目录,尽管配置正确,但清理快照不起作用。 .

      要更正路径,请转到:

      Repositories Administration --> Managed Repositories Management --> 编辑“Archiva Managed Snapshot Repository” --> 将“Directory”参数设置为正确的值(对我来说是“/var/lib/apache-archiva-2.2 .0/repositories/snapshots”)。

      执行此操作时,快照清理开始工作。

      [编辑 - 2017-11-02]

      另外,我想知道为什么在清理主要工件时没有清理一些附加的工件(例如 html 文件)。我刚刚弄清楚了:如果它不是来自 Archiva 的工件类型,则必须指定扩展名。 例如,在我的情况下,在存储库扫描 --> 文件类型 --> 工件 --> 我必须添加 '**/*.html' 以开始清理附加的 html 文件。

      希望对你有帮助

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-11-23
        • 2019-04-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多