Google App Engine模块可以像Maven Modules一样共享源代码吗? [英] Can Google App Engine Modules share source code just like Maven Modules?

查看:161
本文介绍了Google App Engine模块可以像Maven Modules一样共享源代码吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Google App Engine来创建一个由多个 Google模块。如何设置我的项目(使用Maven),以便我可以在模块之间共享源代码,如Objectify对象模型定义,共享实用程序代码和单元测试代码?



我希望答案很简单,我可以像以下答案那样使用Maven:





但是,我担心Google App Engine模块可能会有所不同从Maven模块。然后可能上面的方法将无法正常工作。



作为我为什么关心的一个例子,请注意 Google表示尽管Java EE支持WAR文件,但模块配置仅使用解包的WAR目录。以上建议将共享代码打包到JAR文件中。我知道WAR和JAR是不同的,但我担心我会浪费我的时间,试图让一些工作不能。



有关如何共享代码的任何建议在Google App Engine模块中?

解决方案

我有一个共享目录包含我想在模块之间共享的代码。



然后我可以将我的模块目录中的符号链接到共享目录



符号链接可以是文件,子目录或整个共享目录本身。 p>

I'm using Google App Engine to create a project consisting of multiple Google Modules. How do I set up my project (using Maven) so that I can share source code such as Objectify object model definitions, shared utility code, and unit test code across the modules?

I'm hoping the answer is simple and that I can just use Maven as suggested in answers such as these:

However, I'm concerned there might be something special about Google App Engine modules that makes them different from Maven modules. And then maybe the approaches above won't work.

As an example of why I'm concerned, notice that Google says "Although Java EE supports WAR files, module configuration uses unpacked WAR directories only." yet some of the solutions given above suggest packaging the shared code into JAR files. I realize WAR and JAR are different but I'm worried I'll waste my time trying to make something work that can't.

Any advice on how to share code among Google App Engine modules?

解决方案

I have a share directory that contains code I want to share between modules.

Then I can make symlinks from my modules directories to the share directory.

The symlinks can be of a file, sub-directory, or the whole share directory itself.

这篇关于Google App Engine模块可以像Maven Modules一样共享源代码吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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