javajbossmigrationseam

How to merge 2 version of same very large project


So, i am in charge of a migration from Java 1.5 to Java 1.8. First at all we change the compiler (from Ant to Maven), and later we reformat a lot of code. We also removed Seam framwork, that took us a considerable time.

up here all right.

the problem is that other colleagues continued working in version 1.5 and now I need to bring all those changes made. This includes new entities, packages, datas, Hibernate configurations and even a change in the database schema.

The question is, how can I move these changes without an eternal headache? Note that there has been a change in basically 75% of the files, since almost all the annotations in the project were changed.

Thank you very much and sorry for my bad English.


Solution

  • So there is not going to be any magic tool that will automatically merge all the changes but there are definitely tools out there that will help with looking at and keeping track of the differences between all the versions you need merged.

    Situations like this are why its imperative to use good common coding practices and version control! I recommend taking a look a setting up a GIT repository or some form of modern version control for your project.

    The way I would go about making this merge is as follows:

    1. Create an initial Git repository of the project before any of the changes were made (before the 1.8 changes / or colleagues changes)
    2. Copy the files of the project with the most changes made to the repository ensuring that you preserve the git settings for the repository (hidden .git folder)
    3. You should be able to run a git status to see the files that were added/modified/removed and 'git diff' to see the actual changes
    4. Commit the changes
    5. Bring in the next of changes into the GIT repository
    6. Using git status / git diff to look at the differences in the files, look through the changes keeping what you need (repeat until all colleagues changes are merged)

    There are different tools that will help look at differences ( diff ) in files

    With proper version control and a good diff tool should be able to merge your changes :)