Skip to content

Common structure of pom.xml files

Change Type:

  • Feature
  • Bugfix
  • Refactoring

Context and Scope

Currently we have several issue with current common structure of pom.xml files:

  1. It contain direct dependency on Community GitLab - making it hard to run build pipelines from isolated perimeters:
<repository>
  <id>${gitlab-server}</id>
  <url>https://community.opengroup.org/api/v4/projects/118/packages/maven</url>
</repository>
  1. Child pom files duplicate <repositories> and <distributionManagement> sections of the pom.

Please see Delivery service as an example of the service that already use this approach.

Decision

  1. Introduce common naming convention for Git repos variables:
  • repo.releases.id - source repo for release version of maven dependencies
  • repo.snapshot.id - source repo for snapshot version of maven dependencies
  • publish.releases.id - target repo for publishing of release version of artifacts
  • publish.snapshot.id - target repo for publishing of snapshot version of artifacts
  • etc
  1. Community configuration will be available for each module in .mvn/community-maven.settings.xml.

  2. There will be profiles both for local development and for GitLab CICD

  3. For community-maven.settings.xml there will be a Default profile to work with Community, so developers could use: mvn clean compile -s .mvn/community-maven.settings.xml on local environment.

  4. Information about community profiles and configuration of Local environment will be documented.

  5. Remove duplication of repositories and distributionManagement in child projects and move them to parent POMs

Rational

  • This will remove dependency of code on OSDU infrastructure and will allow to build with operator specific Maven configurations
  • Remove code duplication

Consequences

  • Developers should be aware of changes and configure their Local environments
  • .mvn/community-maven.settings.xml should be applied for CICDs outside of Community GitLab.
Edited by Dmitriy Rudko
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information