On this page:
Summary: Information and Release Notes about the JEE File Discoverer for the CAST Delivery Manager Tool. This extension is a file system discoverer.
This discoverer detects projects based on the presence of java files.
This extension should be used when the java project files such as .project or pom.xml are not delivered with the source code (without these files, the discoverers provided "out of the box" in the CAST Delivery Manager Tool cannot detect all java files). In summary the extension provides a "catch-all" to ensure that all java files will be packaged for analysis
When the extension is installed, you can choose to activate it or not in each package you create in the CAST Delivery Manager Tool. To do so, click the Package Configuration tab and define the type of projects to discover in the package (refer to the Extension interface paragraph below).
Please be aware that this extension is only intended to be used as a fall-back for projects where "out of the box" discoverers provided in CAST AIP are not enough. It should be used in parallel with or instead of the other discoverers. On large projects it can produce sub-optimal analysis configurations, with some side effects that can impact the stability of results.
This extension is designed to detect java files in the following scenarios:
The package identified in the first java file matches the folder hierarchy. In this situation one project is created by the discoverer as follows:
For example, for a java file with the following folder hierarchy C:\temp\project1\src\com\cast\test.java, the project will be named "project1", the root path will be "project1" and the selected folder is "project1/src".
Similar to Case 1 above, when a sub-folder "src" and a sub-folder "test" are located inside the same folder "project1", the project created by the discoverer ("project1") will reference the two folders for the source code: "project1/src" and "project1/test".
In this situation the java files do not have a package and one project will be created by the discoverer for each java file that is discovered (and not each folder). The project name uses the same name as the discovered java file.
|This is known as an Unnamed Package and will be recorded as such in the CAST Delivery Manager Tool log - see Unnamed Package below for more information.|
In this situation, the package doesn't match the folder hierarchy (for example, a.b.c.class1 but the folders a and b are missing). A warning is displayed and the folder c is considered as the main package. The parent folder of c is selected for the source code and the grand-parent is used for the project name and root.
|This is known as an Incomplete Package and will be recorded as such in the CAST Delivery Manager Tool log - see Incomplete Package below for more information.|
Similar to Case 4 above, however, the java file is not located in the correct folder. In this situation (known as an "UnmatchingPackage") the behavior of the discovery is the same as Case 4, however, the log file generated by the CAST Delivery Manager Tool will contain the following to indicate the nature of the discovery:
|This is known as an Unmatching Package and will be recorded as such in the CAST Delivery Manager Tool log - see Unmatching Package below for more information.|
In this situation, each Java branch is assigned to a separate project, for example:
In the above situation (known as a ParentProject), two projects will be created.
|This is known as a Parent Project and will be recorded as such in the CAST Delivery Manager Tool log - see Parent Project below for more information.|
No dependencies (in the CAST Management Studio > Application editor > Dependencies tab) will be automatically created based on the use of this extension since the "discovery" is based on the presence of java files, rather than Maven or Eclipse projects. As such, you may need to manually create dependencies between Analysis Units to achieve any inter-Analysis Unit links you require.
When upgrading from CAST AIP 7.0.x to a compatible version (see section below), the java projects already discovered in CAST AIP 7.0.x and all previous configuration changes made in the CAST Management Studio will be preserved.
In order to respect this requirement and the project renaming conventions from v7.0.xx, the extension will remove any character from the project name that is not included in the following character set:
CAST AIP release
The following screen shots show the differences in the product when the extension is installed:
Click to enlarge:
|When the extension is installed after the creation of the package, the item shown above is not selected by default. If you activate it after the Package action has been executed, you must re-package (without forcing the re-extraction) to discover the projects.|
|Exclude all 'Java file per package folder' projects when a full JEE project also exists for these files||If the "out of the box" JEE discoverer and the "JEE File Discoverer" identify projects for the same java files, then the "JEE File Discoverer" projects will be ignored in the Package Content tab after packaging in favour of the standard "out of the box" JEE discoverer projects.|
|Exclude all 'Java file per package folder' projects with an incomplete package||If the "JEE File Discoverer" identifies projects known as "Incomplete Packages" (as shown in the packaging log), then these will automatically be ignored in the Package Content tab after packaging.|
|Exclude all 'Java file per package folder' projects with an unnamed package||If the "JEE File Discoverer" identifies projects known as "" (as shown in the packaging log), then these will automatically be ignored in the Package Content tab after packaging.|
Click to enlarge:
Click to enlarge:
Click to enlarge:
Click to enlarge:
When you use the CAST Delivery Manager Tool to package the source code, please ensure that you tick the following option in the CAST Delivery Manager Tool to activate the extension:
When packaging your source code and you have activated the JEE File Discoverer, the following messages will be present in the log file to help you understand the nature of the discovery:
|Note that for performance reasons, the extension only scans ONE .java file per folder it encounters, therefore it is highly recommended that if a log message is emitted for a .java file in a specific folder, ALL the .java files in that folder are manually checked consistency.|
Java file %FILE_PATH% has no package, and will lead to a specific JEE file project
Java file %FILE_PATH% has an invalid package, and will be skipped
This warning corresponds to an invalid declaration in the java file, for example:
These invalid declarations are typically found in "scrap" .java files, i.e. files which are bundled in the delivery but which are not taken into account during compilation.
Java file %FILE_PATH% has an incomplete package
Java file %FILE_PATH% has an unmatching package
Java project %PROJECT_NAME% under %PROJECT_PATH% contains additional Java projects