锡兰复制工具 [英] The ceylon copy tool

查看:212
本文介绍了锡兰复制工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ceylon版本1.2.3的ceylon copy命令下载依赖项:

I'm using the ceylon copy command of ceylon version 1.2.3 to download a dependency:

./bin/ceylon copy --rep  "http://repo.maven.apache.org/maven2/" -out outdir "joda-time:joda-time/2.9.4"

为什么工具会跳过下载呢?

Why is the result that the tools skips downloading it?

Module joda-time:joda-time/2.9.4 [1/1]) Skipped.

此工具除了其他外,还包括:

The tool looks - among others - for:

http://repo.maven.apache.org/maven2//joda-time:joda-time/2.9.4/joda-time:joda-time-2.9.4.jar 

...但它应该寻找:

... but it should look for:

http://repo.maven.apache.org/maven2/joda-time/joda-time/2.9.4/joda-time-2.9.4.jar

逻辑上以下应该可以工作:

Logically the following should then work:

./bin/ceylon copy --rep  "http://repo.maven.apache.org/maven2/" --out here --verbose --jvm "joda-time/2.9.4"

...但它告诉我:

... Module joda-time/2.9.4 not found ...

...类似:

./bin/ceylon copy --rep  "http://repo.maven.apache.org/maven2/" --out here --verbose --jvm "joda-time-2.9.4.jar"

...以及:

./bin/ceylon copy --rep  "http://repo.maven.apache.org/maven2/" --out here --verbose --jvm "joda-time-2.9.4"

如何使复制工具正确构造URL并将模块下载到本地存储库?

How can I make the copy tool construct the url correctly and get the module downloaded to my local repository?

推荐答案

这里的正确答案是,复制工具不是用于复制Maven模块。

Really the correct answer here is that the copy tool is not meant for copying Maven modules.

复制工具是你有一个已经编译好的模块,可能有依赖关系,你想把它复制到其他的仓库中去运行它。

The whole idea of the copy tool is that you have an already compiled module, possibly with dependencies, and you want to copy it to some other repository to be able to run it there. Depending on your use-case you might want to include it's dependencies while copying or not.

在这种情况下,复制Maven模块并不太有道理,因为a)他们会以某种方式从Maven模块转换为Ceylon模块(这不总是一个简单的过程,这就是为什么我们有一个特殊工具 ceylon import-jar 帮助你做那)。和b)同时你的导入代码仍然会引用Maven导入,这意味着即使复制工具将复制那些Maven模块,你的原始模块仍然会使用Maven仓库中的模块!您必须更改导入并重新编译代码才能使此工作生效。

In this scenario copying the Maven modules doesn't make too much sense because a) they would be somehow converted from being Maven modules into Ceylon modules (this is not always a trivial process, and that's why we have a special tool ceylon import-jar to help you do that). And b) at the same time your importing code would still refer to the Maven imports which means that even if the copy tool would have copied those Maven modules your original module would still use the modules from the Maven repository! You'd have to change the imports and recompile the code to make this work.

因此,您遇到的错误是Ceylon 1.2.2甚至尝试这样做。我刚刚在1.2.3复制工具做了一个更改,它将总是跳过任何模块,不是从锡兰仓库。

So the bug you encountered is Ceylon 1.2.2 even trying to do so. I've just made a change in the 1.2.3 copy tool where it will always skip any modules that don't come from a Ceylon repository. Its documentation has been updated to make that clear.

感谢您提请我们注意!

这篇关于锡兰复制工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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