Saturday 24 September 2011

Maven-ise your Eclipse (Indigo)

With the transition of the Maven2Eclipse plugin project from the Sonatype boys to the Eclipse umbrella, support for running Maven from within Eclipse has become smoother and definitely easier. To get started, install the Maven2Eclipse plugin from within Eclipse using the Help->Install new software menu option. The link to the plugin download is http://download.eclipse.org/technology/m2e/releases but verify the same from the  plugin site.
After successfully installing Maven, you will have access to several Maven project wizards that will help you get started with a Maven project with a few clicks as shown in the example below as I did for Eclipse Indigo.

  • Select a New project and choose Maven project. Click through the next few steps. You will get an option to choose the Maven archetype and specify the GroupId, Artifact Id, Version and Package






















  • After you select the required options, the wizard will generate a project file structure and populate it with some skeleton code including a Junit test.











  • That's it. You have created a Maven based project which is now awaiting functionality. Adding new dependencies, plugins to the project and the POM is made easy using the Maven project menu, available by right clicking on the project folder and selecting the required option.























  • A Maven Build can be set-up and initiated from the Run- As menu option. 













  • Selecting the Maven build option for the first time which will bring up a set-up configuration dialog that will enable you to specify the goals, profiles and set up any required parameters.

















  • Once the Run configuration is ready, you can build your Maven project and deploy your snapshot.

No comments: