Summary: this page describes how to manage Project Exclusion Rules.

Introduction

Most official CAST "discoverers" (the tools used to determine automatically which projects exist in delivered source code and therefore which Analysis Units will be created in Console for determining the analysis perimeter) include Project Exclusion Rules. These rules are used to determine what Console should do when certain conditions are met - take for example the following rules which aim to prevent multiple projects from being "discovered" for the same source code:

  • Exclude Maven Java projects when an Eclipse project also exists
  • Exclude ASP.NET web projects when a Visual C#/basic .NET project also exists

Discoverers are currently either provided in AIP Core, or are provided as standalone extensions. The behaviour is slightly different for each:

  • discoverer embedded in AIP Core > rules are always available in the Discover step
  • discoverer provided as standalone extensions > rules will not be available until a rescan is performed. This is because extensions are only installed as part of the Prepare step just before the Analysis step and so rules will not be available in the initial onboarding.

Each rule is either enabled or disabled and will be set to one or the other by default, but can be set manually per Application version, or per Node. There are two methods available for managing these rules, described below.

Managing rules via the UI

Access to rules is provided as follows:

Onboarding with Fast Scan

When using the onboarding with Fast Scan workflow - see Administration Center - Settings - Application Onboarding, Project Exclusions Rules are not exposed in the UI: instead, all rules are set to their defaults. If you need to change any rules, use the configuration file as described below.

Legacy onboarding (without Fast Scan)

Rules can be accessed in the source code delivery workflow in the Exclusions step when adding a new version for a new application, or when adding a new version for a rescan:

By default all rules are set to their defaults, but can be modified if required:

Managing rules via a configuration file

In Console ≥ 2.4, rules can also be managed via an XML configuration file. This file is provided with the Node installer and is located here:

%PROGRAMDATA%\CAST\AIP-Node\project-exclusion-rules-config.xml

Each discoverer and its rules are referenced as follows:

<library symbol="dmtjeefilediscoverer">
	<entity symbol="SelectorExcludeJeeFilePackageProjects"
			label="Exclude all 'Java files per package folder' projects when a full JEE project also exists for these files"
			enabled="true"/>
	<entity symbol="SelectorExcludeIncompletePackageJEEProjects"
			label="Exclude all 'Java files per package folder' projects with an incomplete package" enabled="true"/>
	<entity symbol="SelectorExcludeGenericPackageJEEProjects"
			label="Exclude all 'Java files per package folder' projects with an unnamed package" enabled="true"/>
	<entity symbol="SelectorExcludeWebJSPToJavaFiles"
			label="Exclude all 'Web JSP project' when 'Java Files Per package Folder' exists for the same web.xml file"
			enabled="true"/>
	<entity symbol="SelectorExcludeDuplicateJEEWithoutProject"
			label="Exclude Java Files project located inside other Java Files Project" enabled="false"/>
</library>

If you would like to enable or disable a rule, change the enabled= parameter to either true (enabled) or false (disabled) as required. You will then need tor restart the Node to ensure that the changes are taken into account. Changes are also reflected in the UI.

  • Enabling or disabling a rule via the XML file will mean that the changes are reflected in all Applications that use the Node.
  • Because Console 2.x functions in load balancing mode by default, if you have multiple Nodes, and you make changes to the project-exclusion-rules-config.xml file on one specific Node, you MUST make the same changes on all Nodes. This is because analysis results will differ if Analysis 1 is performed with Node 1 (where a change has been made) and Analysis 2 is performed with Node 2 (where the change has NOT been made).