On this page:
Summary: This section describes how to package, deliver and analyze your JEE application source code using the CAST Delivery Manager Tool.
Packaging and delivering your source code
Once the extension is installed, no further configuration changes are required before you can package your source code and run an analysis. The process of packaging and delivering your source code is as follows:
You can refer to the existing official CAST AIP documentation for more information about the CAST Delivery Manager Tool packaging and delivery process - see: Delivery.
Using the CAST Delivery Manager Tool:
- create a new Version
- create a new Package for your JEE application source code using the Files on your file system option:
- Define the root folder of your Application source code (click to enlarge):
- Run the Package action (click to enlarge):
- On completion, check the Package Content tab to see how the CAST Delivery Manager Tool has discovered and interpreted your JEE application:
- You need to pay particular attention to the following items (click to enlarge):
- Content State: displays the current state of the source code - if any alerts are listed, then this means that the CAST Delivery Manager Tool was not able to find all the application's source code based on configuration files such as pom.xml or .project
- Projects Found: all projects found that are listed as Selected will be transformed into an Analysis Unit in the CAST Management Studio when you deliver the source code. Any that are marked as Ignored will not be automatically transformed into Analysis Units
- Packaging Alerts: as stated above, if any alerts are listed, then this means that the CAST Delivery Manager Tool was not able to find all the application's source code based on configuration files such as pom.xml or .project. You should remediate this as explained below before you deliver the source code
- When you are happy that the Package Content tab accurately reflects your JEE application source code, deliver the Version:
Discovery - how does it work?
Discovery is a process whereby the CAST Delivery Manager Tool will attempt to automatically identify projects (for example: an Eclipse Java project) within your application using a set of predefined rules. When the Package action is complete, you can view the projects that have been identified in the Package Content tab.
When a successfully Packaged application is subsequently deployed in the CAST Management Studio, an Analysis Unit will be created for each project that has been identified during the Discovery process and is not excluded by a rule or filter.
How does it work for JEE applications?
Supported project type | Notes | Source Package configuration |
---|---|---|
Eclipse project support (all versions greater than 3) | Configures a project for each Eclipse Java project (.project with Java nature) identified |
|
Maven project simplified support (versions 2 and 3) | Configures a project on each folder that contains a pom.xml file except when the type of packaging declared in the pom.xml is "pom". Note that project inheritance and project aggregation is supported |
|
Note that any Maven project whose type is set to "eclipse-plugin" will be ignored by the Maven discoverer. An "eclipse-plugin" project means that an associated Eclipse project also exists and therefore should be handled by the Eclipse discoverer. In this siutation, CAST highly recommends that you tick the following exclusion rule in the CAST Delivery Manager Tool:
Managing packaging alerts
If any alerts are listed during the packaging action, then this means that the CAST Delivery Manager Tool was not able to find all the application's source code based on configuration files such as pom.xml or .project. You should remediate these alerts as explained in the following video:
Analyzing your source code
Using the CAST Management Studio:
- Accept and deploy the Version in the CAST Management Studio. Any projects that were discovered in the CAST Delivery Manager Tool will be transformed into Analysis Units:
- You should now check and edit (if necessary) the default automated analysis configuration settings that have been set for you during the package deployment:
- JEE Analyzer - Analysis configuration
- JEE Analyzer - Environment Profiles
- JEE Analyzer - Analysis messages
When you are satisfied that you have configured your analysis correctly, we suggest that you run a test analysis at Application level before you generate a new snapshot (no results will be saved to the CAST Analysis Service):
- On completion, you should check the test analysis log file and then clear up any warning or error messages that have been returned by reconfiguring the analysis - see JEE Analyzer - Analysis messages for more information about log messages:
- When all issues and problems have been resolved, you can then use the Run Analysis only option to perform an analysis AND save the results in the CAST Analysis Service:
- When using the Run Analysis only option, you can specify various analysis debug options, specific to JEE - note that these are for advanced debugging of analysis and are normally not required:
Option | Description | |
---|---|---|
Keep Generated Files from JSP | When you select this option, generated .JAVA files for the JSP Implementation Classes will be stored in the LISA folder. | Please note that for all these options, any generated files will be stored in the LISA folder as follows: <Unique_Application_ID>\<source_code_folder>\J2EEGenerated files See Preferences > CAST General in the CAST Management Studio for more information about the location of the LISA folder. |
Keep Generated Files from Java Annotations | When you select this option, XML Annotation files generated when an Environment Profile (that includes detection of Java annotations) is used, will be stored in the LISA folder. I.e. intermediate files that are generated from Java annotations and that are used by XML query files to manage Java annotation semantic (i.e. create objects and links induced by annotations) will be copied into the LISA folder. | |
Keep Generated Files from EJB | When you select this option, generated files for EJB will be stored in the LISA folder. | |
Keep Generated Files from Web Service | When you select this option, generated files for Web Services will be stored in the LISA folder. | |
Keep Generated CAST Script from XML and Annotations | This option enables you to choose a location to store the .castscript files that are generated following an analysis (via Environment Profile) that uses the XQuery/Zorba processing mechanism. This can be particularly useful if you are receiving errors during the analysis and you want to modify your XQuery file so that it outputs syntax that can be understood by the JEE Analyzer. If this option is deactivated, .castscript files will still be generated, but they will not be retained after the analysis. | |
Activate CAST Scripts traces | When the checkbox is selected, all Log messages with DEBUG level called in .castscript files will be logged in the analysis log as an information message with the prefix "DEBUG: ", for example: log("this is a debug message", DEBUG) will generate Information "DEBUG: This is a DEBUG message" in the Log. This information can help you refine and tune your .castscript function so that they work as expected. See also Manage XML configuration files. |