The goals of oparent are to centrally define shared parent POM definitions and configurations such as nexus (distributionManagement) location, coding styles, license checks, coding style checks, sonar setup, etc.
- Isolate all the common external dependencies, default version, dependency management,plugin management, etc.
- Avoid duplicate/conflicting settings for each project
- Each project sets its parent to inherit the defaults from ONAP Parent
- Project level external dependencies and versions can be overridden if necessary
Ultimately this will ensure consistency across ONAP projects, and free individual projects from redundant work whenever the standard configurations need to be changed.
See the current versions and release notes for O-Parent at https://onap.readthedocs.io/en/latest/submodules/integration.git/docs/release-notes.html#o-parent.
How to Implement for Your Project
Inherit from oparent
To use oparent, make sure that the oparent POM is set as the ultimate parent POM for all your POM files. If your project already has its own parent POM, then you just need to make this change at that one POM file.
Set the parent POM in your pom.xml as follows. Be sure to use the current version of oparent as declared in the version manifest; see ONAP Version Manifest Maven Plugin (Decommissioned).
Remove redundant configuration items
Once the POMs have been modified to inherit from oparent, you can now remove the redundant configuration items such as nexus (distributionManagement) location, coding styles, license checks, coding style checks, sonar setup, etc. from your own project POM files. Any necessary changes to the above can now be managed centrally without your project having to incur additional overhead.
If the oparent POM does not provide something that you need or causes conflicts, please provide feedback to the Integration team so that we can update oparent accordingly.
Notes on Releasing OPARENT
- Update the dependencies/pom.xml with any updated versions of upstream projects.
- this should be done with the security team to identify the acceptable or better version
- project team repos should also be validated to make sure they understand any implications on client code before they up-rev
- The merge of this change should create a maven merge job log that can be referenced
- This should be X.Y.Z-SNAPSHOT as the revision.
- Discuss at the PTL call that an updated version of OPARENT will be released.
- Use the LF self-release process to create the releases/X.Y.Z.yaml file that points to the maven merge job and the release number
- The self release jobs should run and publish the maven artifact for X.Y.Z release.
- After that job runs you need to up-rev the version of oparent
- This changes the revision to X.Y.Z+1-SNAPSHOT (or whatever X,Y,Z combination is appropriate) in all the affected files.
- oparent repository would now be ready for step 1.