How to install M2Eclipse plugin in Eclipse Helios

how to install m2eclipse plugin in eclipse and how to use m2eclipse in eclipse and how to work with m2eclipse and how to download m2eclipse
LexiWills Profile Pic
LexiWills,United Kingdom,Professional
Published Date:31-07-2017
Your Website URL(Optional)
Comment
Edition 1.3 m2eclipse 0.12 Maven Integration for EclipseChapter 1. Introduction to m2eclipse 1.1. Introduction The Eclipse IDE is the most widely used IDE for Java development today. Eclipse has a huge amount of plugins (see http:// www.eclipseplugincentral.com/) and an innumerable amount of organizations developing their own software on top of it. Quite 1 simply, Eclipse is ubiquitous. The m2eclipse project, provides support for Maven within the Eclipse IDE, and, in this chapter, we will explore the features it provides to help you use Maven with Eclipse. 1.2. m2eclipse The m2eclipse plugin (http://m2eclipse.sonatype.org/) provides Maven integration for Eclipse. m2eclipse also has hooks into the features of both the Subclipse plugin (http://subclipse.tigris.org/) and the Mylyn plugin (http://www.eclipse.org/mylyn/). The Subclipse plugin provides the m2eclipse plugin with the ability to interact with Subversion repositories, and the Mylyn plugin provides the m2eclipse plugin with the ability to interact with a task-focused interface that can keep track of development context. Just a few of the features m2eclipse provides include: • Creating and importing Maven projects • Dependency management and integration with the Eclipse classpath • Automatic dependency downloads and updates • Artifact Javadoc and source resolution • Creating projects with Maven Archetypes • Browsing and searching remote Maven repositories • POM management with automatic update to dependency list • Materializing a project from a Maven POM • Checking out a Maven project from several SCM repositories • Adapting nested multi-module Maven projects to the Eclipse IDE • Integration with Web Tools Project (WTP) • Integration with Subclipse • Integration with Mylyn • Form-based POM Editor • Graphical Display of Dependency Graph • GUI Presentation of Dependency Tree and Resolved Dependencies There are many more features in m2eclipse beyond the list above and this chapter introduces some of the more impressive features that are currently available. Let’s get started by installing the m2Eclipse plugin. 1 http://m2eclipse.codehaus.org/Chapter 2. Installing m2eclipse 2.1. Installing the Eclipse IDE Sonatype recommends installing m2eclipse on Eclipse 3.5 or Eclipse 3.6, and to make use of m2eclipse you will need to install the JDK. To download an Eclipse IDE distribution: 1. Go to http://www.eclipse.org/downloads/ in a web browser. 2. Download an Eclipse distribution. Note: If you want to use the m2eclipse WTP integration, download the Eclipse IDE for JavaEE Developers distribution. 1 3. Install Eclipse - for more information about installing the Eclipse IDE, see the Eclipse Wiki . 2.2. Installing m2eclipse in Eclipse 3.6 (Helios) with the Eclipse Marketplace The Eclipse Marketplace makes it easy to install m2eclipse and m2eclipse (Extras) in Eclipse 3.6 (Helios). To open the Eclipse Marketplace, go to the Eclipse Help menu and select Eclipse Marketplace... as shown in Figure 2.1, “Opening the Eclipse Marketplace”. Figure 2.1. Opening the Eclipse Marketplace The first time you open the Eclipse Marketplace, you will be asked to select a Marketplace. Select the Eclipse Marketplace as shown in Figure 2.2, “Selecting the Eclipse Marketplace”. 1 http://wiki.eclipse.org/Eclipse/InstallationFigure 2.2. Selecting the Eclipse Marketplace 2.2.1. Installing Maven Integration for Eclipse (Core) Maven Integration for Eclipse is separated into two components: the Core of Maven Integration for Eclipse and an optional package of extra, unsupported components. To install the core component of Maven Integration for Eclipse, open the Eclipse Marketplace, select the Search tab, and search for "Maven Integration" as shown in Figure 2.3, “Selecting Maven Integration for Eclipse from Eclipse Marketplace”. Click on the Install button to the right of the second item listed in Figure 2.3, “Selecting Maven Integration for Eclipse from Eclipse Marketplace”. Figure 2.3. Selecting Maven Integration for Eclipse from Eclipse Marketplace Once you click on Install, Eclipse will download a list of available components from the remote update site and present you with a list of available features in the Maven Integration for Eclipse plugin as shown in Figure 2.4, “Selecting the Core m2eclipse Feature for Installation”. Select the single, required component named "Maven Integration for Eclipse (Required)", and click on the Finish button. 4Figure 2.4. Selecting the Core m2eclipse Feature for Installation Eclipse will then ask you to agree to the licenses for Maven Integration for Eclipse in the Review Licenses step shown in Figure 2.5, “Agreeing to Software License During m2eclipse Installation”. Maven Integration for Eclipse is distributed under the Eclipse Public License version 1.0. If you agree with the conditions of this license, select "I accept the terms of the license agreement" and click on the Finish button. Figure 2.5. Agreeing to Software License During m2eclipse Installation During the installation process, Eclipse may warn you that the software you are installing contains "unsigned content". If you see the dialog shown in Figure 2.6, “Ignoring Warning During m2eclipse Installation”, click on OK to continue the installation process. Figure 2.6. Ignoring Warning During m2eclipse Installation Once m2eclipse has been installed, Eclipse will prompt you to either restart or apply changes to a running Eclipse. At this stage of the installation, you should click on Restart Now to restart your Eclipse instance. After a successful restart, Maven Integration for Eclipse will be installed. 5Figure 2.7. Restarting Eclipse after m2eclipse Installation 2.2.2. Installing Maven Integration for Eclipse (Extras) Prerequisites The Maven Integration for Eclipse extra components provide support for additional tools like the Web Tools Project (WTP), Subversion integration via Subclipse, and integration with Mylyn. The following sections provide guidance for users installing some of the prerequisites for m2eclipse extra components. 2.2.2.1. Installing Subclipse in the Eclipse Marketplace To install Subclipse in the Eclipse Marketplace, open the Marketplace, select the Search tab, and search for "Subclipse" to see the dialog shown in Figure 2.8, “Selecting Subclipse from the Eclipse Marketplace”. Click on Install next to the Subclipse search result item. Figure 2.8. Selecting Subclipse from the Eclipse Marketplace Select the appropriate Subclipse components, agree to the software license for Subclipse, and restart your Eclipse installation after the installation process is completed. 2.2.2.2. Installing Mylyn in the Eclipse Marketplace To install Mylyn in the Eclipse Marketplace, open the Marketplace, select the Search tab, and search for "Mylyn" to see the dialog shown in Figure 2.9, “Selecting Mylyn from the Eclipse Marketplace”. Click on Install next to the Mylyn search result item. 6Figure 2.9. Selecting Mylyn from the Eclipse Marketplace Select the appropriate SMylyn components, agree to the software license for Mylyn, and restart you Eclipse installation after the installation process is completed. 2.2.3. Installing Maven Integration for Eclipse (Extras) To install the extra components for Maven Integration for Eclipse, open the Eclipse Marketplace, select the Search tab, and search for Maven Integration to see the search results shown in Figure 2.10, “Selecting Maven Integration for Eclipse (Extras) from the Eclipse Marketplace”. CLick on Install next to the "Maven Integration for Eclipse (Extras)" search result item. Figure 2.10. Selecting Maven Integration for Eclipse (Extras) from the Eclipse Marketplace Once you have clicked on Install, Eclipse will download the list of available plugin components from the remote update site. The list of available components will then be displayed in the Confirm Select Features step as shown in Figure 2.11, “Selecting m2eclipse (Extras) Components to Install”. The components available in the Maven Integration for Eclipse (Extras) site are: 7M2Eclipse Extensions Development Suppport (Optional) Install this component if you want to develop custom pages in the POM Editor, create custom actions in the Maven popup menu, provide custom templates in the POM XML editor, or make other customizations to m2eclipse. Maven Integration for WTP (Optional) If you are developing applications using the Eclipse Web Tools Project, this component will adapt the Maven classpath container and other Maven resources to the WTP standards. Maven issue tracking configurator for Mylyn 3.x (Optional) Maven can be configured to work with Mylyn a comprehensive issue and time tracking plugin which currently ships with the Eclipse IDE. Maven SCM handler for Subclipse (Optional) Subclipse is a popular Subversion plugin for Eclipse hosted by the Tigris community. If you want to use Maven with Subclipse, this component will provide the necessary integration between the two plugins. Maven SCM handler for Team/CVS (Optional) This component provides integration between the m2eclipse plugin and the CVS support built into Eclipse. Maven SCM Integration (Optional) This component is required if you installed one of the previous plugins (Subclipse or Team/CVS) Project configurators for commonly used maven plugins (temporary) This is a temporary project which contains project configurators for commonly used Maven Plugins. Figure 2.11. Selecting m2eclipse (Extras) Components to Install Once you have selected the features you wish to install, click Next. Clicking Next will bring you to the Review Licenses step as shown in Figure 2.12, “Agreeing to Software License During m2eclipse (Extras) Installation”. The m2eclipse Extras is distributed under the Eclipse Public License version 1.0. If you agree to this open source license, select "I accept the terms of the license agreement" and click on "Finish". 8Figure 2.12. Agreeing to Software License During m2eclipse (Extras) Installation During the installation process for the m2eclipse Extras, you may receive some warning that "you are installing software that contains unsigned content". If you see the dialog shown in Figure 2.13, “Ignoring Warning During m2eclipse (Extras) Installation”, click OK to continue the installation process. Figure 2.13. Ignoring Warning During m2eclipse (Extras) Installation Once the installation process is finished, Eclipse will prompt you to apply the changes or restart your Eclipse instance with a dialog shown in Figure 2.14, “Restarting Eclipse after m2eclipse (Extras) Installation”. To complete the installation of m2eclipse (Extras), restart your Eclipse instance. Figure 2.14. Restarting Eclipse after m2eclipse (Extras) Installation 2.3. Installing m2eclipse in Eclipse 3.5 (Gallileo) 2.3.1. Installing m2eclipse Core Components To install m2eclipse, use the following Eclipse update site to install the core of the m2eclipse plugin. This Core update site contains a single component: "Maven Integration for Eclipse (Required)". When you install this component you will be installing all of the core Wizards, the POM Editor, Maven Repository integration, and Maven integration: 9• m2eclipse Plugin: http://m2eclipse.sonatype.org/sites/m2e To install this plugin in the Eclipse IDE: 1. Select Help Install New Software. This should display the "Install" dialog. 2. Paste the Update Site URL into the field named "Work with:" and press Enter. Pressing Enter should cause Eclipse to update list of available plugins and components. 3. Choose the component listed under m2eclipse: "Maven Integration for Eclipse (Required)". 4. Click Next. Eclipse will then check to see if there are any issues which would prevent a successful installation. 5. Click Next and agree to the terms of the Eclipse Public License v1.0. 6. Click Finish to begin the installation process. Eclipse will then download and install the necessary components. Once the installation process is finished, Eclipse will ask you if you want to restart the IDE. Sonatype strongly recommends that you restart your IDE after installing m2eclipse. Warning You cannot upgrade from m2eclipse 0.9 to m2eclipse 0.10. If you are running m2eclipse 0.9.8 or 0.9.9 you must either uninstall m2eclipse from your Eclipse installation or start with a fresh installation of Eclipse. If you've installed the plugin successfully, you should see a Maven option in the list of preference categories when you go to Window, Preferences.... 2.3.2. Installing m2eclipse Extras In addition to the core m2eclipse components, the following optional components are available from a separate update site. If you plan to use m2eclipse to materialize projects from Subversion or CVS, integrate Maven with the Eclipse Web Tools Project (WTP), or use the m2eclipse Mylyn integration you will need to install the following, extra components: • Maven SCM Integration • Maven SCM handler for Team/CVS • Maven SCM handler for Subclipse • Maven issue tracking configurator for Mylyn 3.x • Maven Integration for WTP • M2Eclipse Extensions Development Support To install optional m2eclipse components, use the m2eclipse Extras update site. This update site contains the following m2eclipse components: • m2eclipse Extras Update Site: http://m2eclipse.sonatype.org/sites/m2e-extras 2.3.3. Installing Optional Prerequisites Several of the extra components listed in the previous section require third-party plugins to be installed prior to installation. You can install these prerequisites when you install m2eclipse, just add a new remote update site to Eclipse for each of the prerequisite components. 10To install these prerequisites, select Help, Install New Software... which will load the "Software Updates and Add-ons" dialog. In this dialog, choose the Available Software panel and click on Add Site... which will load the simple "Add Site" dialog. Enter the URL of the update site you wish to add and click OK. In the "Software Updates and Add-ons" dialog, the available plugins from an update site will appear as soon as the site is added. You can then select the modules you want to install and click the Install... button. Eclipse will then resolve all the dependencies for the selected plugins, and ask you to agree to the plugin license. After Eclipse installs new plugins, you should restart the IDE. 2.3.3.1. Installing Subclipse When you install Subclipse, you will need to make a decision about Subversion compatibility. If you are using Subversion 1.5.x client features, you will need to install Subclipse version 1.4. If you are using Subversion 1.6.x client features, you will need to install Subclipse version 1.6. To install Subclipse, use one of the Eclipse plugin update sites listed below. • Subclipse 1.4 (for Subversion 1.5 compatibility): http://subclipse.tigris.org/update_1.4.x • Subclipse 1.6 (for Subversion 1.6 compatibility): http://subclipse.tigris.org/update_1.6.x For other versions of Subclipse, and for more information about the Subclipse plugin, please see the Subclipse project's web site at http://subclipse.tigris.org/. 2.3.3.2. Installing Mylyn To install JIRA or Trac integration with Mylyn, add the Mylyn extras Eclipse update URL, you'll want to do this if your organization 2 uses Atlassian's JIRA for issue tracking. To install Mylyn use the following update sites: • Mylyn (Eclipse 3.4, 3.5, and 3.6M4): http://download.eclipse.org/tools/mylyn/update/e3.4 • Mylyn Extras (JIRA and Trac Support): http://download.eclipse.org/tools/mylyn/update/extras For more information about the Mylyn project, see the Mylyn project's web site at http://www.eclipse.org/mylyn/. 2.3.3.3. Installing the Web Tools Platform (WTP) To install the Web Tools Platform (WTP). Install the "Eclipse IDE for Java EE Developers" from http://www.eclipse.org/downloads/ , or download a WTP release from http://download.eclipse.org/webtools/downloads/. For more information about the Web Tools Platform, see the Web Tools Platform project's web site at http://www.eclipse.org/ webtools/. 2.4. Uninstalling m2eclipse from Eclipse 3.6 (Helios) with the Eclipse Marketplace To uninstall m2eclipse and m2eclipse (Extras) from Eclipse 3.6 (Helios), open up the Eclipse Marketplace by selecting Eclipse Marketplace from the Eclipse Help menu. Once you have the Eclipse Marketplace dialog open, select the Installed tab as shown in Figure 2.15, “Selecting Maven Integration for Eclipse Components to Uninstall”. To uninstall either "Maven Integration for Eclipse" or "Maven Integration for Eclipse (Extras)", click on the "Uninstall" button next to each item. 2 http://www.atlassian.com/software/jira/ 11Figure 2.15. Selecting Maven Integration for Eclipse Components to Uninstall If you are uninstalling "Maven Integration for Eclipse", the Eclipse IDE will prompt you to select the feature you wish to uninstall as shown in ???. Select the feature to uninstall, and click on Next to continue. Figure 2.16. Selecting Components to Install for Maven Integration for Eclipse Installation If you are uninstalling "Maven Integration for Eclipse (Extras)", the Eclipse IDE will prompt you to select the features you wish to uninstall as shown in Figure 2.17, “Selecting Maven Integration for Eclipse (Extras) Features to Uninstall”. Select the features to uninstall, and click on "Finish" or "Next". 12Figure 2.17. Selecting Maven Integration for Eclipse (Extras) Features to Uninstall Once the uninstallation has successfully completed, Eclipse will prompt you to either apply changes or restart. To complete the uninstallation process, click on "Restart Now". Figure 2.18. Restarting Eclipse after Uinstallation 13Chapter 3. Creating and Importing Projects 3.1. Creating a Maven Project When using Maven, project creation takes place through the use of a Maven archetype. In Eclipse, project creation takes place via the new project wizard. The new project wizard inside of Eclipse offers a plethora of templates for creating new projects. The m2eclipse plugin improves upon this wizard to provide the following additional capabilities: • Checking out a Maven project from a SCM repository • Creating a Maven project using a Maven archetype • Creating a Maven POM file As shown in Figure 3.1, “Creating a New Project with m2eclipse Wizards”, all three of these options are important to developers using Maven. Let’s take a look at each one. Figure 3.1. Creating a New Project with m2eclipse Wizards 3.1.1. Checking Out a Maven Project from SCM m2eclipse provides the ability to check out a project directly from a SCM repository. Simply enter the SCM information for a project and it will check it out for you to a location of your choice as shown in Figure 3.2, “Checkout a New Project from Subversion”:Figure 3.2. Checkout a New Project from Subversion There are additional options in this dialog for specifying a particular revision by browsing the revisions in a Subversion repository or by simply entering the revision number manually. These features reuse of some of the features in the Subclipse plugin to interact with the Subversion repository. The m2eclipse plugin supports the following SCM providers: • Bazaar • Clearcase • CVS • git • hg • Perforce • Starteam • Subversion • Synergy • Visual SourceSafe 3.1.2. Creating a Maven Project from a Maven Archetype m2eclipse offers the ability to create a Maven project using a Maven Archetype. There are many Maven Archetypes provided in the list that comes with m2eclipse as shown in Figure 3.3, “Creating a New Project with a Maven Archetype”. 16Figure 3.3. Creating a New Project with a Maven Archetype The list of archetypes in Figure 3.3, “Creating a New Project with a Maven Archetype” is a list generated by something called the Nexus Indexer. Nexus is a repository manager which is introduced in "Repository Management with Nexus", a free book available 1 from Sonatype which can be read online here: http://www.sonatype.com/books/nexus-book/reference/ . The Nexus indexer is a file which contains an index of the entire Maven repository, and m2eclipse uses it to list all of the available archetypes in the entire Maven repository. When this chapter was last updated, m2eclipse had approximately ninety archetypes in this Archetype dialog. Highlights of this list include: • Standard Maven Archetypes to create • Maven Plugins • Simple Web Applications • Simple Projects • New Maven Archetypes 2 • Databinder Archetypes (data-driven Wicket Applications) under net.databinder 3 • Apache Cocoon Archetypes under org.apache.cocoon 4 • Apache Directory Server Archetypes under org.apache.directory.server 5 • Apache Geronimo Archetypes under org.apache.geronimo.buildsupport 6 • Apache MyFaces Archetypes under org.apache.myfaces.buildtools 1 ??? 2 http://databinder.net/site/show/overview 3 http://cocoon.apache.org/ 4 http://directory.apache.org 5 http://geronimo.apache.org 6 http://myfaces.apache.org 177 • Apache Tapestry Archetypes under org.apache.tapestry 8 • Apache Wicket Archetypes under org.apache.wicket 9 • AppFuse Archetypes under org.appfuse.archetypes 10 • Codehaus Cargo Archetypes under org.codehaus.cargo 11 • Codehaus Castor Archetypes under org.codehaus.castor 12 19 • Groovy-based Maven Plugin Archetypes (deprecated) under org.codehaus.mojo.groovy • Jini Archetypes 13 • Mule Archetypes under org.mule.tools 14 • Objectweb Fractal Archetypes under org.objectweb.fractal 15 • Objectweb Petals Archetypes under org.objectweb.petals • ops4j Archetypes under org.ops4j 16 • Parancoe under org.parancoe • slf4j Archetypes under org.slf4j 17 • Springframework OSGI and Web Services Archetypes under org.springframework 18 • Trails Framework Archetypes under org.trailsframework 19 And these were just the archetypes that were listed under the Nexus Indexer Catalog, if you switch Catalogs you'll see other archetypes. While your results may vary, the following additional archetypes were available in the Internal Catalog: 20 • Atlassian Confluence Plugin Archetype under com.atlassian.maven.archetypes 21 • Apache Struts Archetypes under org.apache.struts • Apache Shale Archetypes under org.apache.shale A catalog is simply a reference to a repository index. You can manage the set of catalogs that the m2eclipse plugin knows about by clicking on the Configure... button next to the catalog drop down. If you have your own archetypes to add to this list, you can click on Add Archetype.... 7 http://tapestry.apache.org 8 http://wicket.apache.org 9 http://appfuse.org/display/APF/Home 10 http://cargo.codehaus.org/ 11 http://castor.codehaus.org/ 12 http://groovy.codehaus.org/GMaven 13 http://mule.mulesource.org/display/MULE/Home 14 http://fractal.objectweb.org/index.html 15 http://petals.objectweb.org/index.html 16 http://www.parancoe.org/ 17 http://www.springframework.org 18 http://www.trailsframework.org/ 19 Don't use the Groovy Maven Plugin in Codehaus' Mojo project. Jason Dillon has moved the Groovy Maven integration to the Groovy project in codehaus. For more information see http://groovy.codehaus.org/GMaven. 20 http://www.atlassian.com 21 http://struts.apache.org 18Once you choose an archetype, Maven will retrieve the appropriate artifact from the Maven repository and create a new Eclipse project with the selected archetype. 3.1.3. Creating a Maven Module m2eclipse provides the ability to create a Maven module. Creating a Maven module is almost identical to creating a Maven project as it also creates a new Maven project using a Maven archetype. However, a Maven module is a subproject of another Maven project typically known as a parent project. Figure 3.4. Creating a New Maven Module When creating a new Maven module you must select a parent project that already exists inside of Eclipse. Clicking the browse button displays a list of projects that already exist as shown in Figure 3.5, “Selecting a Parent Project for a New Maven Module”: Figure 3.5. Selecting a Parent Project for a New Maven Module After selecting a parent project from the list, you are returned to the New Maven Module window and the Parent Project field is populated as shown in Figure 3.4, “Creating a New Maven Module”. Clicking Next will then display the standard list of archetypes from Section 3.1.2, “Creating a Maven Project from a Maven Archetype” so you can choose which one should be used to create the Maven module. 19

Advise: Why You Wasting Money in Costly SEO Tools, Use World's Best Free SEO Tool Ubersuggest.