Adding a new Java™ or JavaServer Page (JSP) project
When you add a new Java™ project to the application, you specify the project name, browse to the working directory, and then specify the source roots and project dependencies.
About this task
The steps in this topic direct you to complete all pages in the New Project Wizard (or New Application Wizard, if you are creating the project in it). However, some of the pages in the wizard are optional (required settings are complete when the Finish button is activated). Settings made in the wizard can be modified after project creation in the Properties view for a selected project. If you complete the New Project Wizard without completing optional pages, you can change the settings from those pages later on in the Properties view.
Procedure
- In the Explorer view, select the application that you want to add the project to (if you have not already added an application, see Configuring applications).
-
Complete one of these actions to open the New Project Wizard:
- Select from the main workbench menu.
- Right-click the selected application and choose from the context menu.
- In the Select Project Type page of the wizard, select Java/JSP as the project type and then click Next to advance to the next wizard page.
- In the Project Sources wizard page:
- In the JSP Project Dependencies page:
Click Finish to add the project with JSP project dependencies - or click Next to identify Java™ project dependencies.
- In the Java™ Project
Dependencies page, identify the dependencies required to build this Java™ project:
- Click Finish.
Results
Tip:
If you are scanning Java and there are missing dependencies in your Java project, AppScan®
Source
will create traces by synthesizing the pieces that the dependencies would have provided. This
synthesis may not accurately reflect the information in .jar files. To limit
synthesis and thereby improve the accuracy of findings, you can specify the missing dependencies, as follows:
- After scanning, open <data_dir>\logs\StaticAnalyzer-Errors.log (where <data_dir> is the location of your AppScan® Source program data, as described in Installation and user data file locations) to see if AppScan® Source has reported missing dependencies.
- Modify the project properties to include the dependencies. To do this, follow the instructions in Modifying application and project properties and then specify and save the dependencies in the JSP Project Dependencies or Project Dependencies tab.
- Re-scan the project.
Note:
By default, AppScan®
Source
scans Java files and Java byte code with missing dependencies or compilation errors. These settings
can be changed as follows:
- Open <data_dir>\config\scan.ozsettings in a text editor.
- To change the compilation error setting, locate
compile_java_sources_with_errors
in the file. This setting will look similar to:<Setting name="compile_java_sources_with_errors" value="true" default_value="true" type="bool" hidden="true" display_name="compile_java_sources_with_errors" description="Attempt to scan java code with compilation errors." />
- To change the missing dependency setting, locate
scan_without_dependency_jar
in the file. This setting will look similar to:<Setting name="scan_without_dependency_jar" value="true" default_value="true" type="bool" hidden="true" display_name="scan_without_dependency_jar" description="Scans Java bytecode even when some of the dependencies are missing by artificially synthesizing the unresolved symbols." />
- In the setting, modify the
value
attribute. If the attribute is set totrue
, this setting will be on. If the compilation error setting is set tofalse
, AppScan® Source will skip Java code with compilation errors during scans. If the missing dependency setting is set tofalse
, AppScan® Source will not scan Java bytecode if there are missing dependencies. - Save the file after you have modified this setting and start or restart AppScan® Source.