JBoss.orgCommunity Documentation

Chapter 4. Adding Maven support to an existing project

Select the project that Maven support will be added to from the Project Explorer.

Selecting Convert to Maven Project from the context menu of the chosen project.

Figure 4.1. Selecting Maven project conversion


Right-click on the project to bring up the context menu.

From the context menu navigate to ConfigureConvert to Maven Project.

Selecting Convert to Maven Project from the context menu of the chosen project.

Figure 4.2. Selecting Maven project conversion


Click on the Convert to Maven Project menu option.

A Maven POM wizard will launch. The wizard will create a pom.xml file for your project. This file will contain the projects Maven settings. All necessary fields of the wizard will be automatically filled.

The wizard to create a pom.xml file for your project.

Figure 4.3. Maven POM wizard


It is recommended that you change the Packaging option to pom to avoid any issues in expansion of the project with Maven modules in the future.

Showing the selection of pom from the drop-down menu of the Packaging setting.

Figure 4.4. Changing Packaging setting to pom


Click Finish.

Once Maven support has been added to the project, a new pom.xml file will appear in the list of files for the project. This can be viewed in the Project Explorer.

The project now has a new pom.xml file, seen in the Project Explorer.

Figure 4.5. New pom.xml file


Double-click on the pom.xml file to view the settings associated with it. The settings here were set in the Maven POM wizard and can be edited from this Overview screen.

The Overview screen for the new pom.xml file.

Figure 4.6. Overview screen for pom.xml