本文档翻译自:https://docs.conan.io/en/latest/reference/commands/misc/alias.html

    1. $ conan alias [-h] reference target

    创建并导出“别名软件包配方”。
    “别名”程序包是另一个程序包(目标)的符号名称(引用)。 当某些程序包依赖别名时,将检索并使用目标程序包,因此别名引用(符号名)不会出现在最终依赖关系图中。

    1. positional arguments:
    2. reference Alias reference. e.g.: mylib/1.X@user/channel
    3. target Target reference. e.g.: mylib/1.12@user/channel
    4. optional arguments:
    5. -h, --help show this help message and exit

    命令:

    1. $ conan alias hello/0.X@user/testing hello/0.1@user/testing

    使用以下内容为hello/0.X@user/test创建并导出软件包配方:

    1. from conans import ConanFile
    2. class AliasConanfile(ConanFile):
    3. alias = "hello/0.1@user/testing"

    此类包装配方可作为别名参考的“代理”。 取决于hello/0.X@user/testing的用户实际上将使用hello/0.1@user/testing版本。 别名包引用将完全不会出现在依赖关系图中。 定义符号名称或诸如“始终取决于最新的次要名称”之类的行为很有用,但是要在上游定义而不是在version-ranges下游定义。

    “别名”软件包应采用与常规软件包配方相同的方式上载到服务器,以便能够从服务器使用。