如何停止使用快照的Maven版本范围 [英] how do I stop maven version ranges from using snapshots

查看:188
本文介绍了如何停止使用快照的Maven版本范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Maven POM中使用版本范围:

I am using version ranges in my maven POM:

<version>[3.0.0,)</version>

,对于此特定工件,仓库中有一个3.0.0版本和一个3.0.1-SNAPSHOT.当我尝试发布时,由于使用了SNAPSHOT版本,因此无法发布.

and for this particular artifact there is a 3.0.0 version in the repo and a 3.0.1-SNAPSHOT. When I try to do a release it fails as the SNAPSHOT version is used.

我试图通过编辑设置文件来禁止使用快照来解决这个问题,但仍然失败:

I have tried to get round this by editing my settings file to dis-allow the use of snapshots but it still fails:

<repositories>
    <repository>
        <id>EFX Nexus Repository</id>
        <url>myUrl</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>

谢谢

推荐答案

这是基本的Maven问题.

This is basic maven issue.

当您在一行中启动多个命令时.例如说mvn版本:解决范围全新安装...在发行版本时将获取SNAPSHOT.

When u fire multiple commands in single line..say mvn versions:resolve-ranges clean install...it will fetch SNAPSHOT when do release build.

尝试单独执行命令.

首先运行mvn版本:解析范围,然后执行clen install

first run mvn versions:resolve-ranges and then clen install

这篇关于如何停止使用快照的Maven版本范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆