ceylon.http.server
、ceylon.json
、ceylon.io
モジュールを利用する簡単なアプリを作ろうとしています。
コンパイルすると、次のエラーが発生します。
Error:(4, 8) ceylon: source code imports two different versions of module 'com.redhat.ceylon.langtools.classfile': version '1.3.1' and version '1.3.2'
Error:(4, 8) ceylon: source code imports two different versions of module 'com.redhat.ceylon.model': version '1.3.1' and version '1.3.2'
Error:(4, 8) ceylon: source code imports two different versions of module 'com.redhat.ceylon.common': version '1.3.1' and version '1.3.2'
なぜそれらを取得するのですか? Ceylon は、異なるバージョンで同じモジュールを使用しても問題ないと思いました。セイロンツアーのパッケージとモジュールでは、「モジュールの分離と、同じモジュールの複数のバージョンを管理する機能を備えたランタイム」と明示的に述べています。
私module.ceylon
はこのように見えます:
native ("jvm")
module server "1.0.0" {
import ceylon.http.server "1.3.2";
import ceylon.json "1.3.2";
import ceylon.io "1.3.2";
}
私の(唯一の)ソースファイルrunServer.ceylon
は次のようになります。
import ceylon.http.server { ... }
import ceylon.io { ... }
"Run the module `server`."
shared void runServer() {
//create a HTTP server
value server = newServer {
//an endpoint, on the path /hello
Endpoint {
path = startsWith("/hello");
//handle requests to this path
service(Request request, Response response) =>
response.writeString("hello world");
}
};
//start the server on port 8080
server.start(SocketAddress("127.0.0.1",8080));
}