Restriction: This is only applicable to JVM COBOL and JVM COBOL Unit Testing projects.
When you create a Maven-based project, the
pom.xml is added as a project artifact. It is populated with a number of mandatory details, including some Micro Focus-related goals.
- cobolDependencies
- This goal is bound to the
validation phase.
- This goal acts like a dependency: it serves as a link from your application to the required COBOL JVM run-time system and
libraries. This setting uses the COBDIR environment setting to locate these files. If COBDIR is not set, you can use the
cobdir configuration tag in the POM to point to the product installation directory.
-
Important: This does mean that you can only build Maven artifacts containing COBOL JVM and COBOL JVM unit tests on a machine that has
the
Enterprise Developer product installed.
- cobolCompile
- This goal is bound to the
compile phase.
- This goal links to the COBOL compiler, and also takes some additional (non-mandatory) configurations that are not passed to
the compiler through conventional methods. The additional configurations, again set within the configuration tags, are:
- threadCount, which you can use to specify the number of threads for a parallel run. This defaults to 1, and is only applicable to projects
built with dynamic calls enabled (ILDYNCALL).
- sourceTab, which you can use to specify the tab size. This defaults to 4.
- copypaths, which you can use to specify the location of your COBOL copy files. This setting is in addition to the COBCPY environment
setting; you can set your copypath using either method.
- cobolTestCompile
- This goal is bound to the
test-compile phase.
- This goal links to the COBOL compiler, and also uses the same configurations as the
cobolCompile goal.
- cobolTest
- This goal is bound to the
test phase.
- This goal links to the required run-time system and libraries when running the tests. It has no associated configurations.
Tip: If you need to use any environment variables in your tests, you can code an
environmentVariables section (within the
configuration section of the
microfocus-maven-plugin plugin), and within it add a tag for each variable; for example:
<configuration>
<environmentVariables>
<env_1>hello</env_1>
<env_2>goodbye</env_2>
</environmentVariables>
</configuration>
The variables are only applicable when the
cobolTest goal is specified.
Note: To run tests through Maven, right-click the
pom.xml file, point to
Run As and select either
Maven Build or
Maven Test. The test results are displayed in the
Console view and in the configured
Reports output folder. (Tests run through Maven are not displayed in the
Micro Focus Unit Testing view.)