有关使用 Clojure 在 Eclipse 上开发 GAE 应用程序的问题
在我的 Eclipse 设置逆时针工作之后 和以交互模式运行的 GAE 开发服务器我发现了这些 我仍然不清楚:
1)如何在不命令它的情况下启动服务器和应用程序 REPL?
2) 当我将应用程序部署到 Google 服务器时,我该如何以及在哪里 定义应用程序的入口点?我的意思是,谷歌怎么会知道 使用哪个应用程序、应用程序处理程序和路由?
3)我可以在同一个项目中结合使用java类和clojure文件吗 以便在创建和编辑它们时自动编译它们 我的 src 文件夹?
4) 上传到 GAE 时实际需要哪些文件和 jar 结束?我习惯将 PHP 应用程序部署到 GAE,但在这里我不知道是否应该制作 jar,包括编译后的 clj 文件。我还可能想以不同于逆时针或 appengine-magic 的方式组织文件,那么我在哪里指定资源和类的路径?
5)最后是否可以连接Google生产服务器 Emacs - Slime - Swank 组合?那将满足 梦想,哈哈。
我将 appengine-magic 与 Jetty、Compojure、Ring 和 Hiccup 一起使用。
After getting counterclockwise working on my Eclipse setup
and GAE development server running in interactive mode I found these
things still unclear for me:
1) How can I start server and application without commanding it on
REPL?
2) When I deploy application to Google servers, how and where do I
define the entry point of application? I mean, how Google will know
which application, application handlers and routes to use?
3) Can I combine using java classes and clojure files on same project
so that both are compiled automatic when creating and editing them on
my src folder?
4) Which files and jars are actually needed for uploading to GAE at
the end? Im used to deploy PHP apps to GAE, but here I dont know if I should make jars, include compiled clj files. I also might like to organize files different way than counterclockwise or appengine-magic does, so where do I specify paths to resources and classes?
5) Finally is it possible to connect Google production server with
Emacs - Slime - Swank combination? That would be the fulfill of
dreams, lol.
I'm using appengine-magic with Jetty, Compojure, Ring and Hiccup.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我将建议采用 lein/appengine-magic/Eclipse 混合方法。使用 appengine-magic 创建您的 GAE 项目,然后在 Eclipse 中进行设置。
web.xml
服务器类,它引用app_servlet.clj
中提前编译的源代码(假设您使用lein appengine-new 最初创建项目)。在
app_servlet.clj
中查找对make-servlet-service-method
的调用 - 参数是您的 App Engine Magic(请参阅def-appengine-app
incore.clj
)入口点。反过来,它指的是您的 Compojure 处理程序和路由。请参阅 https://github.com/gcv/appengine-magic 详细信息。lein appengine-magicprepare
,然后部署部署 war 目录appcfg.sh
(您可以在 GAE Java SDK 中找到它) 。您也许还可以使用 GAE Eclipse 插件来实现此目的。I'm going to suggest a lein/appengine-magic/Eclipse hybrid approach. Create your GAE project with appengine-magic and then set it up in Eclipse.
web.xml
server-class, which refers to the ahead-of-time compiled source inapp_servlet.clj
(assuming you usedlein appengine-new
to create the project originally). Look inapp_servlet.clj
for the call tomake-servlet-service-method
-- the argument there is your App Engine Magic (seedef-appengine-app
incore.clj
) entry point. In turn that refers to your Compojure handler and routes. See https://github.com/gcv/appengine-magic for the details.lein appengine-magic prepare
, then deploy the deploy the war directoryappcfg.sh
(which you can find in the GAE Java SDK). You may also be able to use the GAE Eclipse plugins to achieve this.问题 1 & 2最终得到解决并清除。
问 3 我无法做到这一点,因为 java 或 clojure 类相互覆盖,并且我无法单独更改它们的目标目录。
问题 4 第一次成功部署后,现在我知道要包含的核心基础 jar 是什么。是的,这取决于您在项目中碰巧使用的内容。我认为我在 PHP 部署中传输了太多不必要的文件。
问5 我也是这么想的。但我并没有在开发应用程序引擎服务器上工作。它报告非法访问某些 appengine sdk 文件。也许我需要将它包含在项目库中......
Q 1 & 2 were eventually solved and cleared.
Q 3 I wasnt able to do it because either java or clojure classes overwrote each other and I couldnt change target directories for them separately.
Q 4 after first succesfull deployment now I know what are the core base jars to be included. Yes it depends on what you happen to use on your project. I think I have transferred way too many unnecessary files on PHP deployments.
Q 5 Thats what I thought. But I didnt get swank working on dev app engine server. Its reporting illegal access to some appengine sdk file. Maybe I need to include it on project libs...