Skip to end of metadata
Go to start of metadata

Automatic Discovery of Modules


This was discussed in Continuum Dev List thread subject 'Proposition for CONTINUUM-798'.

Current Scenario

New modules added in POM in a multi-module project are not being added when the parent project is updated in Continuum. The current work-around for this is to build the Project Group to update the source. Then add the new module(s) as new project(s) in that Project Group then trigger the build again. The whole project group will be built including the new module.

Approach for CONTINUUM-798

Below is the planned approach for this issue:

  1. Create an "update-modules" action in continuum-core that will check for new modules in the pom. The action would be invoked when a project build is triggered (forced or scheduled), after the project is updated from SCM (in DefaultBuildController).
    • How will we know which modules are new? The new modules would be captured by comparing the <modules> of the updated POM with all the projects in the Project Group, which could be retrieved from the database. If the project already exists, then it wouldn't be checked out and added to Continuum anymore. Otherwise, it would be checked out, added as a separate project in Continuum and included in the build. The extra projects removed from the Project Group is no longer a concern here since it is no longer in the database.
    • What about the modules that are removed from the POM? Have no fear, we have an answer to that! Do not remove it from Continuum, in any case it wouldn't be included when the parent project is built. It was also mentioned in the thread that it could be marked as removed from the multi-module project and allow the Group Administrator to delete it. A TODO page can be added wherein it would list all the actions (e.g. (project added/deleted/modified, the user that done the action...) that were performed on the Project Group 1. These actions can be 'accepted' or 'refused' by the Group Administrator.
  2. Add the new module to Continuum via the addMavenTwoProject(..) method in DefaultContinuum. The required parameters can be derived from the parent project. The metadata url can be gotten from the SCM url of the parent (since the SCM urls of modules are just constructed from the parent project's SCM url by inserting the module's name in the url). The group id can also be derived from the parent project, as well as the SCM username and SCM password.
  3. Add the project in the build queue after it is added and checked-out so that it will be included in the triggered build.


1 This would be a new feature and should be filed as a separate issue.

Labels
  • None