Removal of O-Parent from Policy
java-only
The following steps are applicable only for java projects.
1 - Remove the oparent as parent tag in the primary pom.xml https://gerrit.onap.org/r/c/policy/parent/+/137695/1/pom.xml
<parent>
<groupId>org.onap.oparent</groupId>
<artifactId>oparent</artifactId>
<!-- When changing, also change the oparent.version property -->
<version>3.3.3</version>
<relativePath />
</parent>
<properties>
<oparent.version>3.3.3</oparent.version>
</properties>
2 - Run mvn clean install in the project where oparent was used and any other project that inherits from it.
For PF, oparent parent tag was removed from policy-parent pom.xml only. All other projects inherit from policy-parent
3 - With all the dependency missing on the mvn clean install run, add them to main pom.xml in dependencyManagement tag. Use this tag specifically to avoid cascade dependency addition.
https://gerrit.onap.org/r/c/policy/parent/+/137695/1/integration/pom.xml
4 - After all missed dependencies fixed, fix the plugins dependencies.
sonar https://gerrit.onap.org/r/c/policy/parent/+/137695/1/pom.xml and https://gerrit.onap.org/r/c/policy/parent/+/137724/1/integration/pom.xml
copy the tags related to sonar properties to main pom.xml
copy sonar plugins tags to main pom.xml
<properties>
.
.
<sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
<!-- Default Sonar configuration -->
<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
<sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
<!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
<sonar.exclusions>org/drools/**/*,**/gen/**,**/generated-sources/**</sonar.exclusions>
.
.
</properties>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar.scanner.version}</version>
<plugin>
copy the distributionManagement tags (https://gerrit.onap.org/r/c/policy/parent/+/137695/1/pom.xml)
<distributionManagement>
<repository>
<id>ecomp-releases</id>
<url>${onap.nexus.url}/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>ecomp-snapshots</id>
<url>${onap.nexus.url}/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
copy jacoco properties and plugins configurations (https://gerrit.onap.org/r/c/policy/parent/+/137695/1/integration/pom.xml and https://gerrit.onap.org/r/c/policy/parent/+/137724/1/integration/pom.xml)
NOTE: policy only have unit tests for sonar; if there are distincts tests for unit and integration and they generate different reports, adjust the plugin configuration accordingly.
copy vulnerability scan profile https://gerrit.onap.org/r/c/policy/parent/+/137695/1/integration/pom.xml
5 - Add to project checkstyle module
Copy the module checkstyle from oparent to main project and configure as a new module
Update maven-checkstyle-plugin with the module reference.
https://gerrit.onap.org/r/c/policy/parent/+/137695
https://gerrit.onap.org/r/c/policy/parent/+/138046
6 - Run mvn clean install and fix possible issues with plugins
7 - Run sonar scan for coverage
docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:latest
Login as admin and the add local project. Follow instructions on screen to attach project to the sonarqube instance.