0

I have a very complex web project developed using Java 6, Struts 1.1 and deployed in a Tomcat 6 server. (Eclipse as IDE)

Now, I have the need to start developing more functions, but I want to start this in new modules, independent from the big project, so this module can be deployed separately, and also, this will help me to manage more developers working in parallel.

I know how to do this, if the module only have logic, I can make a new project and export as a jar? but in this case, I´ll have JSP pages too.. any ideas?

Roman C
  • 49,761
  • 33
  • 66
  • 176
Keetah
  • 261
  • 1
  • 5
  • 15
  • 1
    Related: http://stackoverflow.com/questions/11210628/how-do-i-include-a-jsp-file-from-a-diff-project-into-my-project – BalusC Jan 08 '13 at 17:57
  • If the modules are tightly connected, and the existing app is monolithic, you don't have a lot of options. Does the new functionality make use of existing functionality? Can you extract shared functionality into a new library you could deploy with both the original and new functionality? Are you tied to using Struts 1.1 for the new functionality?! That's a ***very*** old version and should not be used for new development. – Dave Newton Jan 08 '13 at 18:41
  • @Dave Yes I have to extract shared functionality to a new jar (i can do this), the main problem for me is to handle the UI, i mean, i have a principal page with a menu, one option in the menu will reference pages in the main, project, but other link, to the new module (and this module should be able to have all the session information) – Keetah Jan 09 '13 at 16:03

2 Answers2

1

You should consider migrating to Apache Maven, which manages your dependencies and encourages you to structure your code into a parent project and sub-modules. It will also help enable your project to be worked in parallel by multiple developers.

Sonatype has a couple of online books that do a good job of introducing Maven:

Eric Levine
  • 13,536
  • 5
  • 49
  • 49
  • Maven doesn't force you to have modular projects. – Dave Newton Jan 08 '13 at 19:28
  • @DaveNewton wrong choice of wording on my part. It doesn't force you to, but does encourage dividing up your project into submodules. – Eric Levine Jan 08 '13 at 20:29
  • @elevine, thank you. Just a question, it is possible to migrate my project to Maven? In don´t know anything about Maven :( – Keetah Jan 09 '13 at 16:15
  • @Rodrigo Sure it is; any project can be made into a Maven project. It's best to follow Maven's [Standard Directory Layout](http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). – Dave Newton Jan 09 '13 at 16:21
  • @DaveNewton I still have the doubt, it is possible to have a new web project, that, when deployed, both project mix in only one ? – Keetah Jan 09 '13 at 17:37
  • 1
    @Rodrigo You're asking two different questions: (1) Can I make my project a Maven project, and (2) Can I do what I want with my modules. (1) Any project can be a Maven project. (2) You can do pretty much anything you want in terms of creating deployable artifacts, although the weirder you get, the harder it is. You may want to open a new question if you have very specific needs. – Dave Newton Jan 09 '13 at 17:54
  • @DaveNewton thanks.. (1) is ok (2) is my problem. how can i have two web modules, but deployed as only one. For example, one module have user CRUD, the other have clients CRUD, but when deployed is only one web app. – Keetah Jan 09 '13 at 18:08
  • @Rodrigo You can create a war file based on an arbitrary set of artifacts, from arbitrary directories--my concern would be that it would be difficult to manage and troubleshoot beyond the simplest of use-cases. Without knowing more specifics, though, it's tough to say. – Dave Newton Jan 09 '13 at 19:00
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/22479/discussion-between-rodrigo-and-dave-newton) – Keetah Jan 09 '13 at 20:15
  • I think i need War Overlay. http://maven.apache.org/plugins/maven-war-plugin/examples/war-overlay.html – Keetah Jan 10 '13 at 18:09
0

The ear format supports deploying multiple applications (war files) as a unit. Not sure if this helps in your situation, though.

GreyBeardedGeek
  • 29,460
  • 2
  • 47
  • 67