I have two GAE Java projects, A and B. I want to use some of the mature classes from A in B (and continue to use them in A too, of course). Both projects were created using maven and then imported into Eclipse (in my mind, this kinda makes maven primary and Eclipse secondary :-).
What is the best way to do this, keeping maven primary?
I expect the solution will be something like:
- Create a new maven project C.
- Move the common classes to C.
- Include C as dependency in pom.xml of A and B (possible to do this without first exporting C as a jar?).
Hopefully after this I will be able to run and test (mostly done by running mvn appengine:devserver
) A and B independent of each other.
My knowledge of maven is limited, so how do I create (e.g., which archetype to use) this project C such that:
- it will import successfully as an independent Eclipse project,
- be export-able as a jar (if need be), and,
- trigger re-build of A and B when C changes, whether it is Eclipse auto-recompiling or maven recompiling when I run
mvn appengine:devserver
If there is a better but completely different solution, I wouldn't mind considering that too.
Configuration:
- OS: OS X 10.9.5
- maven: 3.1.1
- Eclipse: Kepler (4.3) with m2eclipse
- Java: 1.7.0_45
Thanks!!