1

I'm working with multiple Java Play projects and I want to work with my subproject in a different way than I do now but I don't know how to do that. I'm working with three projects, let's call them A, B and Sub. Sub is my subproject and it used in A and B in a different way, but both projects need Sub. At the moment, I have two times the code of Sub in: [A-Project]/modules/sub [B-Project]/modules/sub

Twice the same code which needs to be synchronized. I'd like to pack my subproject just in an archive like a JAR-file and include it in both projects A and B as a library. Is there a way to do that or do I have to work with two different folders for the same project? :/

Thank you for your help!

Michael Zajac
  • 55,144
  • 7
  • 113
  • 138
Milgo
  • 2,617
  • 4
  • 22
  • 37

1 Answers1

0

I would consider having Sub be placed within its own package, and then having both Project A and Project B import that package. This will only be efficient if Sub is being used in generally the same way in both A and B. If Sub is being modified that much and you really don't want to Override too much, you might be better off placing a different version of Sub in each project.

dclifford
  • 27
  • 3
  • Okay, how could I import that package? That's what I don't get. I'm using Sub in the same way in both projects. – Milgo Aug 12 '15 at 12:47
  • http://stackoverflow.com/questions/12248906/importing-packages-in-java try looking through that submission. – dclifford Aug 12 '15 at 19:11
  • Okay, well, I know how to use a normal Java project in a JAR. It's quite different with a project from Play Framework, because it's using SBT. – Milgo Aug 27 '15 at 17:00