Extension Points and API

How to use Extension points page explains how to create new Eclipse plugin to use extension points below.

Custom pages in Maven POM editor (since 0.9.7)

The Maven POM editor can be extended by adding custom pages using the following extension point:

The org.foo.FooPageFactory class should extend MavenPomEditorPageFactory and could look something like this:

In the above example, FooPage class should extend org.eclipse.ui.forms.editor.FormPage and it could use MavenPomEditor API to get information about Maven project opened in the editor and other m2eclipse API to get information from the Eclipse workspace. For example:

Custom actions in Maven popup menu (since 0.9.6)

Custom actions can be contributed using org.maven.ide.eclipse.m2menu extension point. For example:

The MavenJdtMenuCreator should implement org.maven.ide.eclipse.actions.AbstractMavenMenuCreator and could look like this:

In the above example FooAction implements org.eclipse.ui.IObjectActionDelegate. To track selection, FooAction.selectionChanged() method is being called on selection change.

Custom templates in POM XML editor (since 0.9.4)

Custom templates can be contributed using org.eclipse.ui.editors.templates extension point. For example:

The following context types are defined:

  • org.maven.ide.eclipse.editor.xml.templates.contextType.project
  • org.maven.ide.eclipse.editor.xml.templates.contextType.parent
  • org.maven.ide.eclipse.editor.xml.templates.contextType.properties
  • org.maven.ide.eclipse.editor.xml.templates.contextType.properties
  • org.maven.ide.eclipse.editor.xml.templates.contextType.dependencies
  • org.maven.ide.eclipse.editor.xml.templates.contextType.exclusions
  • org.maven.ide.eclipse.editor.xml.templates.contextType.plugins
  • org.maven.ide.eclipse.editor.xml.templates.contextType.repositories
  • org.maven.ide.eclipse.editor.xml.templates.contextType.groupId
  • org.maven.ide.eclipse.editor.xml.templates.contextType.artifactId
  • org.maven.ide.eclipse.editor.xml.templates.contextType.version
  • org.maven.ide.eclipse.editor.xml.templates.contextType.classifier
  • org.maven.ide.eclipse.editor.xml.templates.contextType.type
  • org.maven.ide.eclipse.editor.xml.templates.contextType.packaging

Project configuration (since 0.9.4)

Pre-configured Maven repository indexes (since 0.9)

See Nexus Indexer

Maven Archetype Catalogs (since 0.9.3)

Maven Archetype Catalogs allow to narrow package set of Maven archetypes that can be selected in the "New Maven Project" wizard. Those catalogs can be also packaged within eclipse plugins using org.maven.ide.eclipse.archetypeCatalogs extension point. The following declaration defines two Archetype catalogs, first one is packaged withing Eclipse plugin and second is pointing to remote HTTP location:

SCM Integration (since 0.9.2)

SCM handlers are used to check out Maven projects from Materialize Maven Project and Checkout Maven Project wizards.

Several SCM handlers had been implemented:

To add custom SCM handler class you can extend org.maven.ide.eclipse.scm.ScmHandler and contributed using the following extension point:

To support provider specific repository and history browsing provider can contribute SCM handler UI that should extend org.maven.ide.eclipse.scm.ScmHandlerUi and contributed using the following extension point:

To allow "Checkout as Maven project…" action recognize custom models and enable this action in custom views (such as Subclipse’s Repositories view) and object popup menu contributions you need to provide an IAdaptable for org.maven.ide.eclipse.scm.ScmUrl class. There is two options:

  • make your objects implement IAdaptable interface and provide corresponding implementation of getAdapter() method
  • contribute a runtime adapter factory and adapt your objects to org.maven.ide.eclipse.scm.ScmUrl

For example, adapter factory extension point for Subclipse to adapt its ISVNRemoteFolder look like this:

Then SubclipseUrlAdapterFactory can be implemented like this: