Working with Apache Maven

You can now build your local native COBOL and COBOL JVM projects (and their unit testing equivalents) using Maven from the IDE. This allows you to continue working on your projects in Eclipse, and build them into your wider continuous integration processes.

The project configuration process between native projects and COBOL JVM projects is slightly different.

COBOL JVM and COBOL JVM unit testing projects can utilize the official Maven plugin for Eclipse: M2Eclipse. This is probably already supplied as part of your Eclipse IDE, but if it is not, you can easily install it using Help > Install New Software.

Maven project configuration centers around the POM file: an XML file that contains all the resources (artifacts, plugins, dependencies, etc...) and build instructions (phases and goals) required to build into your Maven repositories.

After the initial creation of the POM, you are responsible for maintaining it when new dependencies, exclusions, etc.. are added to your project. If using the M2Eclipse plugin, a form-based POM editor allows you to easily manage such edits; for more information, refer to the M2Eclipse home page; otherwise, you can manually edit it, and these following sections give some advice on the edits you can make.

For native COBOL projects (including native unit testing projects), you cannot use the official plugin, but you still configure a pom.xml file to run the maven.antrun.plugin plugin, which wraps the ant-based build process inside the Maven architecture, thus allowing Maven to build ant-based projects.