Uploaded image for project: 'Module Maven Archetype'
  1. Module Maven Archetype
  2. EMMA-7

Use maven properties in config.xml and omod/pom.xml instead of hardcoded values

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 1.1.0
    • Complexity:
      Medium

      Description

      Currently the basicmodule archetype creates a config.xml with hardcoded values for module version, module name, OpenMRS version etc. Also the omod/pom.xml has a hardcoded version number for it's dependency on the api module. This means when updating the versions used by a module you have to change the same thing in multiple places. Replacing these values with maven properties allows most of them to be read from the parent pom. So in the archetype, the config.xml file becomes....

      <module configVersion="1.2">
      <id>${project.parent.artifactId}</id>
      <name>${project.parent.name}</name>
      <version>${project.parent.version}</version>
      <package>${project.parent.groupId}.${project.parent.artifactId}</package>
      <author>${module-author}</author>
      <description>${module-description}</description>
      <require_version>${openMRSVersion}</require_version>
      ...

      ${module-author} and ${module-description} are still substituted with values from the archetype, however the other properties aren't substituted during the archetype:generate goal because project.parent doesn't exist. They are only substituted when building the final module.

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              raff Rafal Korytkowski
              Reporter:
              rowanseymour Rowan Seymour
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: