0

How can I escape the hyphen in a ceylon module descriptor?

import com.fasterxml.jackson-core "2.8.4";

Edit: In this case the jar are downloaded and included in the correct file hierarchy of the local ceylon repository ./repo . So, I expect that I can handle it like any other .car . Then, the only remaining problem is to escape the hyphen in the module name.

4

2 回答 2

3

您可以使用引号。maven:还建议指定显式命名空间:

import maven:"com.fasterxml.jackson.core:jackson-core" "2.8.4";

请参阅第 9.3.10 节。Ceylon 语言规范的“模块描述符”:

注意:引用的模块名称可以与 Maven 和其他模块存储库系统互操作,其模块标识符不符合为 Ceylon 模块名称指定的格式。

于 2017-02-06T08:16:12.940 回答
0

从 Ceylon 1.3.2 开始,首选的语法是引用:

  • 只有 maven 工件 id,因为那是其中经常有破折号的位,并且
  • 不是maven 组 id,因为它几乎总是一个合法的 Ceylon 模块名称。

所以你会写:

import maven:com.fasterxml.jackson.core:"jackson-core" "2.8.8";

我假设是您要导入的模块。

于 2017-04-17T22:05:47.120 回答