Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 18 Next »

Goals

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.

Release Notes

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 using the appropriate version:

oparent master (Guilun) JDK 11 (TB usable by JDK 8)
    <!-- NOT RELEASED YET - TARGET IS M1 -->


	<parent>
        <groupId>org.onap.oparent</groupId>
        <artifactId>oparent</artifactId>
        <version>3.1.0-SNAPSHOT</version>
        <relativePath/>
    </parent>

Formatting Plugin Now Available -  

Oparent now has a formatting plugin available for projects that need to get their source code formatted to meet checkstyle guidelines. Instructions are in the pom.xml on how to use it.

# Clone oparent somewhere local
> git clone https://github.com/onap/oparent.git 

# 1st - your project should be inheriting from this oparent java dependency
> cd <my-repo>
> vi pom.xml

# ensure pom.xml is pointing to 3.1.0-SNAPSHOT or later

# 2nd - go into your project's source directory you wish to reformat
> cd <my-repo-to-reformat>

# 3rd - type in the following and make sure you set the path to where you have oparent cloned and its
              onap-java-formatter.xml file

> mvn formatter:format spotless:apply process-sources -Dproject.parent.basedir=<oparent-clone-location>

# formatter will re-format your source files

# check that the source compiles
> mvn clean install

# the source changes can now be uploaded via git review process

oparent Frankfurt Branch - JDK 11 (Please migrate to 3.1.0-SNAPSHOT)
    <!-- LATEST RELEASE -->
    <parent>
        <groupId>org.onap.oparent</groupId>
        <artifactId>oparent</artifactId>
        <version>3.0.2</version>
        <relativePath/>
    </parent>

    <!-- Current SNAPSHOT -->
    <parent>
        <groupId>org.onap.oparent</groupId>
        <artifactId>oparent</artifactId>
        <version>3.0.3-SNAPSHOT</version>
        <relativePath/>
    </parent>


oparent El Alto branch JDK 8
    <!-- LATEST RELEASE -->
    <parent>
        <groupId>org.onap.oparent</groupId>
        <artifactId>oparent</artifactId>
        <version>2.1.0</version>
        <relativePath/>
    </parent>

    <!-- Current SNAPSHOT -->
    <parent>
        <groupId>org.onap.oparent</groupId>
        <artifactId>oparent</artifactId>
        <version>2.2.0-SNAPSHOT</version>
        <relativePath/>
    </parent>


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.

Providing Feedback

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


  1. Update the dependencies/pom.xml with any updated versions of upstream projects.
    1. this should be done with the security team to identify the acceptable or better version
    2. project team repos should also be validated to make sure they understand any implications on client code before they up-rev
    3. The merge of this change should create a maven merge job log that can be referenced
    4. This should be X.Y.Z-SNAPSHOT as the revision.
  2. Discuss at the PTL call that an updated version of OPARENT will be released.
  3. 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
    1. https://gerrit.onap.org/r/#/c/oparent/+/94862/
  4. The self release jobs should run and publish the maven artifact for X.Y.Z release.
  5. After that job runs you need to up-rev the version of oparent
    1. https://gerrit.onap.org/r/#/c/oparent/+/94863/
    2. This changes the revision to X.Y.Z+1-SNAPSHOT (or whatever X,Y,Z combination is appropriate) in all the affected files.
  6. oparent repository would now be ready for step 1.



  • No labels