Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Java projects and refactoring

I have recently joined a project that is using multiple different projects. A lot of these projects are depending on each other, using JAR files of the other project included in a library, so anytime you change one project, you have to then know which other projest use it and update them too. I would like to make this much easier, and was thinking about merging all this java code into one project in seperate packages. Is it possible to do this and then deploy only some of the packages in a jar. I would like to not deploy only part of it but have been sassked if this is possible.

Is there a better way to handle this?

like image 847
Adam Lerman Avatar asked Dec 31 '22 04:12

Adam Lerman


2 Answers

Approach 1: Using Hudson

If you use a continuous integration server like Hudson, then you can configure upstream/downstream projects (see Terminology).

A project can have one or several downstream projcets. The downstream projects are added to the build queue if the current project is built successfully. It is possible to setup that it should add the downstream project to the call queue even if the current project is unstable (default is off).

What this means is, if someone checks in some code into one project, at least you would get early warning if it broke other builds.

Approach 2: Using Maven

If the projects are not too complex, then perhaps you could create a main project, and make these sub-projects child modules of this project. However, mangling a project into a form that Maven likes can be quite tricky.

like image 103
toolkit Avatar answered Jan 13 '23 14:01

toolkit


If you use Eclipse (or any decent IDE) you can just make one project depend on another, and supply that configuration aspect in your SVN, and assume checkouts in your build scripts.

Note that if one project depends on a certain version of another project, the Jar file is a far simpler way to manage this. A major refactoring could immediately means lots of work in all the other projects to fix things, whereas you could just drop the new jar in to each project as required and do the migration work then.

like image 22
JeeBee Avatar answered Jan 13 '23 15:01

JeeBee