Can Google App Engine Modules share source code just like Maven Modules?

烂漫一生 提交于 2019-11-27 07:13:00

问题


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:

  • How do you use Maven to share source code for two projects?
  • How to create shared source folder across multiple projects in Eclipse?
  • For test code: Sharing src/test classes between modules in a multi-module maven project
  • For test code: Share test resources between maven projects
  • Eclipse Linked Resources: https://stackoverflow.com/a/7585095/2848676. Is this compatible with Maven though?

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?


回答1:


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.



来源:https://stackoverflow.com/questions/27388111/can-google-app-engine-modules-share-source-code-just-like-maven-modules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!