Configuring source code delivery for JEE without .pom file or .project file

Introduction

When adding a new version to analyze an Application that includes JEE based source code and this source code does not contain a .pom or .project file, Console will behave as follows:

Behaviour in Console ≥ 2.3

Console will automatically install the JEE File Discoverer whenever a .java file is encountered in your delivered source code. This extension will ensure that the required Analysis Units are created for your source code and that an analysis can proceed without issue.

Behaviour in Console ≤ 2.2

Console is unable to "discover" this code as JEE (Console relies on the presence of the .pom / .project files). In this situation, the source code delivery will end in failure. In order to resolve this issue, you can manually configure Console to install an extension called the JEE File Discoverer whenever a .java file is encountered in your delivered source code. This extension will ensure that the required Analysis Units are created for your source code and that an analysis can proceed without issue.

Steps to configure this are shown below.

Step 1 - Edit the configuration file

A configuration file (code-scanner-config.xml) must be edited to make this change. This file is available on EACH Node, therefore if you have more than one Node, you will need to make this change on all Nodes where you would like to force the installation of the JEE File Discoverer whenever a .java file is encountered in your delivered source code.

To do so, first locate this file:

2.x - Enterprise mode
%PROGRAMDATA%\CAST\AIP-Node\code-scanner-config.xml

2.x - Standalone mode
%PROGRAMDATA%\CAST\AIP-Console-Standalone\code-scanner-config.xml

1.x
%PROGRAMDATA%\CAST\AipConsole\AipNode\code-scanner-config.xml

Edit the file with a text editor and locate the following commented lines:

<?xml version="1.0" encoding="UTF-8"?>
<packages>
    <!-- List of discoverers for Standard Plugins: -->
    <package packageType="delivery.SourceFilesPackage" extractorType="dmtdevfolderextractor.SourceFolderExtractor">
        <discoverer extensionId="com.castsoftware.dmtcfilediscoverer" dmtId="dmtcfilediscoverer"
                    fileExtensions=".c;.pc;.ppc;.cpp;.cc;.cxx" label="C/C++ files"/>
        <!-- uncomment this if you want to enable jee file discoverer which discovers the java project without .pom or .project files -->
        <!--
        <discoverer extensionId="com.castsoftware.dmtjeefilediscoverer" dmtId="dmtjeefilediscoverer"
                    fileExtensions=".java" label="Java files per package folder"/>
         -->

Uncomment the lines related to the com.castsoftware.dmtjeefilediscoverer entry:

<?xml version="1.0" encoding="UTF-8"?>
<packages>
    <!-- List of discoverers for Standard Plugins: -->
    <package packageType="delivery.SourceFilesPackage" extractorType="dmtdevfolderextractor.SourceFolderExtractor">
        <discoverer extensionId="com.castsoftware.dmtcfilediscoverer" dmtId="dmtcfilediscoverer"
                    fileExtensions=".c;.pc;.ppc;.cpp;.cc;.cxx" label="C/C++ files"/>
        <!-- uncomment this if you want to enable jee file discoverer which discovers the java project without .pom or .project files -->
        <discoverer extensionId="com.castsoftware.dmtjeefilediscoverer" dmtId="dmtjeefilediscoverer"
                    fileExtensions=".java" label="Java files per package folder"/>

Save the file when the changes are complete.

Step 2 - Apply configuration changes

Restart the Nodes to ensure all changes are taken into account:

  • If the Nodes are installed as Windows Services, restart the services
  • If the Nodes are running only using the batch files, close the CMD windows to stop the processes, then restart.