This page describes the issue where you exclude a Maven project from DMT since same Eclipse project exists but the exclusion is not taken into account and the ignored project is still exported to Cast-MS as a duplicate AU.
If you have both Maven and Eclipse projects for the same project, we should be excluding either the Maven or the Eclipse project from the project exclusion.
When packaging is completed we choose to exclude the duplicate maven projects in the project exclusion section in DMT while keeping the Eclipse project as shown below:
The exclusion works as you can see that these excluded jobs are in ignored state when you do the packaging again after exclusion.
But when you deliver it and set as current version from Cast-MS, you can see that the ignored maven project is exported leading to duplicate projects.
Release | Yes/No |
---|---|
8.3.x |
RDBMS | Yes/No |
---|---|
CSS |
Below is the step-by-step scenario leading to the problem:
- Package your code in DMT.
- You observed that you have same projects belongng to Maven and Eclipse.
- Exclude Maven project in the Projects exclusion.
- Re-package.
- See that the Maven project is marked as ignored.
- Deliver.
- Open Cast-MS and set as current version.
- Check the Analysis units to discover that the ignored Maven projects have been exported to Cast-MS.
The impact of the problem on the analysis or the dashboard is that we could have duplicate analysis results in the KB and duplicated objects in the dashboard.
- In CAST MS, go to the delivery tab
- Manage the delivery
- Once the DMT is opened, go the package configuration tab
- Check in the section Which project should we take into account for the analysis ? > Projects to exclude if the Maven vs Eclipse selection rules are correctly set and are not both unselected as below example :
- Go to the package content tab
- Check in the alerts if there are ambiguous project reference.
- If there are, remediate these alerts
- Run the package again
- Check in the package content, in the projects found section that the duplicate projects have been removed.
- If they have been removed, deliver the source.
- If after the set as current version, in the current version tab you still see the duplicate projects:
- proceed as follows to set all duplicate AU (Maven Project) to false that have been duplicated by an Eclipse project.
Close Cast-MS if any instance is open in any environment.
If on Cast Storage Service, open PG Admin and run the below query on your management base:
update cms_j2ee_analysis set active = 0 where object_id in ( select aumaven.object_id from cms_j2ee_analysis aumaven join CMS_J2ee_project pmaven on pmaven.object_id = aumaven.project_id and pmaven.rootpath like '%pom.xml' join cms_j2ee_analysis aueclipse on aumaven.object_name = aueclipse.object_name join CMS_J2ee_project peclipse on peclipse.object_id = aueclipse.project_id and peclipse.rootpath like '%.project' )
Open Cast-MS and check that the AU corresponding to Maven projects are set to false.