Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 636
Michael Osofsky Avatar asked Dec 09 '14 20:12

Michael Osofsky


People also ask

What is the difference between Maven module and Maven project?

a maven module is like a maven "sub-project". a maven project includes 1 or more modules. more info here. Typically, a module generates a single artifact (jar, war, zip, etc), although this is not always true.

Can two Maven modules depend on each other?

Because modules within a multi-module build can depend on each other, it is important that the reactor sorts all the projects in a way that guarantees any project is built before it is required. The following relationships are honoured when sorting projects: a project dependency on another module in the build.

What are the advantages of multi-module maven project?

Why Multi-Module Project? One single command is required to build all projects, including the submodules. Maven always cares about the build order for you. You don't need to worry about that.

What is a maven module?

A Maven module is a sub-project. To create a Maven module you will need to already have a Maven project available. The parent project must have its Packaging option pre-configured to pom, for a module to be created and associated with it.


1 Answers

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.

like image 79
Eyal Levin Avatar answered Sep 30 '22 03:09

Eyal Levin