Converting Eclipse Java Project to Maven Project

From Eclipsepedia

Jump to: navigation, search

Contents

Overview

Using Integration for Apache Maven (IAM)plugin, you can immediately convert existing eclipse java project to maven project.

How To

Just right click on the java project and click "Convert to Maven Project" in the pop-up menu.

     Convertjavatomavenproject.jpg

The first columns contains the basic information of the pom. Source directory and test directory combo box is already filled with current source directories in your class path. In the above image, it is filled with src & test. If it is left blank, the source directory will be automatically src/main/java & test directory will be src/main/test. These are the default directory structure of a maven project.

The table in the second column contains the libraries resolved in the selected java project. You have the option to add it to pom dependency or just leave it as a referenced libraries. If you choose to add it as a dependency, it will be uploaded to your local repository. By default, the jar name is the groupid and artifact id. You have the option of editing the information of each dependency that you wish to add by clicking on the item in the table and click edit button. The remove button will remove the selected library from the dependencies.

The libraries not added to dependency will be left as a referenced libraries.


Proposed Enhancements

Usability/User Interface:

 - Use the wizard interface, to simplify the UI
 - Place the Convert to maven project option in the Maven menu
 - Hide the "Convert to Maven Project" option if it's already a maven project.
 - Some fields have rounded corners in the mac, which is used only for search/filter input boxes.

New features:

- Provide assistance when replacing libraries with dependencies. Using the MD5 of the jar file to look it up on the indexes or in remote services in repositories like Archiva.
 - Provide autocompletion based on known groupIds (use existing indexes)
 - Relocate existing source folders to match maven conventions